-
Notifications
You must be signed in to change notification settings - Fork 2
Color helpers don't work when map keys are CSS colors #16
Comments
I usually sidestep it by naming my variables with |
To me, having only a |
I always use Sip and the names it gives to colors. You can see what kinds of names it gives in the Palettes section of the Features page. Basically to follow this idea you can also use something like Name that color to generate color names. |
That's a cool app! But I just used Sip and Name that color to select a color that was And the David Walsh approach is also to name your colors with the most standard names possible. So none of these actually work around the Sass issue. And definitely not foolproof and requires a lot of knowledge about how the setup and sass work. |
I really haven't run into the issue with it renaming anything other than It feels like the best solution is the dumb one. It really seems like the simplest solution. Probably better practice to quote all the key names anyways. Another option would be to output Sass in a format other than Compressed and use something else to minify the CSS. |
Yeah, I don't use the color helpers almost ever, which is probably why we've never noticed this happening before. Maybe I'll experiment with minifying separately from sass, but probably not worth it. |
Just discovered something really dumb and frustrating:
If you use unquoted color names as keys in a SASS map, Sass will always automatically convert that name to a hexidecimal value any time it is output.
Therefore, when we output the helper classes for the above, we will end up with the following:
To make things even more confusing, Sass will only do this when the output mode is
compressed
, otherwise it will work just fine.This is stupid and maddening to me beyond belief, and I haven't been able to find a simple way to prevent sass from doing this. The "official" suggestion from the Sass team is to quote your map values like so:
But I'm not really willing to do that to solve such a dumb problem. @brianjhanson do you have any ideas about how to sidestep this?
The text was updated successfully, but these errors were encountered: