-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Compilation of named colors results in hex values being used incorrectly in interpolations #1595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See #692. |
Regardless of above I actually also wonder myself what was the original purpose of this "immediate and unconditional" string to hex color conversion only for variables (I'm searching through old issues but didn't find the answer yet). Indeed, this all seems to be strange and confusing:
It does not look like something that fits "Today's LESS" naturally. So, perhaps it is a good time to reconsider this behaviour. Update: I found the corresponding issue (#289) and commits around it.
|
its really difficult because some people also rely on the fact it is turned into hex. in your example, it is like that because less is lazy - I'd support changing this to remember what it was encoded as and use that or default to hex (this is what transparent does) as long as we have a function to get to hex or a colour code. |
I see, yes that makes sense (especially if we already have more consistent
|
Why is the named color not used with the |
Only because I tried to keep the changes as minimal as possible (and I just did not see how bad it could be before I wrote the summary :). Of course I'll change this as soon as we're agree it's not acceptable. |
Fixed with later commits to #1604 |
Fixed in 2.0 branch |
The variable declaration
@myVariable: red;
recognizes that it contains a color, which is useful. However, on compilationdiv { color: @myVariable; }
is compiled to:instead of
By itself, this isn't a huge problem, but it becomes one when attempting to use selector interpolation:
.@{myVariable} { color: @myVariable; }
becomesinstead of
While it makes sense to parse the named color as a color rather than just a string, I'm not sure why the output wouldn't preserve the named color.
The text was updated successfully, but these errors were encountered: