I'm not sure that we're going to convince you on this matter. TL DR put quotes around your named colors if you want them to be strings. Colors are always colors, sass is playing dumb here because dumb things, while sometimes cumbersome, are easy to reason about. We decided a long time ago that we're not going to do that. This is a problem that you're expecting sass to treat named colors as sometimes a string and sometimes a color. This happens because you put a color in a selector but selectors only allow strings and combinators. The string value for colors varies by compression mode. This happens because # says evaluate this expression and put it's string value right here. This should never happen - syntax errors shouldn't occur just because you switch compression modes. Limiting keys to strings is very inconvenient for a lot of use cases. I would expect both to raise an exception. map-get($m, rgb(0, 128, 0)), map-get($m, green), and map-get($m, #008000) all return the same value stored against the same color value in the map. It's like allowing the rgb() function as a key, does that work too? =]
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |