-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Hex colors with opacity tangles up #3290
Comments
Did Less even support hex rgba notation before? |
@rjgotten Not directly, no. But it should just skip (preserve) unrecognized values. That's probably the regression. |
@rjgotten @tapsaman I don't think this was a regression, so much as it wasn't yet supported. However, it was just a few regex changes and changes to the color node to support this form. See the tests in the PR for verification. One thing this does is remove "invalid" colors for future compatibility. It's not until you try to use an "invalid" color in a color operation that it should throw an error at evaluation time. But Less in 3.0+ is more forgiving of values in properties, so this seemed reasonable to remove. |
One thing: should Less convert EDIT: What I did was allow conversion by the author to |
Here are a list of thoughts I'm having relative to this.
tl;dr: I think my overall first impression is that we should ensure the |
That ship has sailed.
Yeah, I guess. But casting is the wrong way to think about it. It also enables this form:
No, thanks for pointing this out. I can add that. Although I'm confused why that function exists at all? |
To rephrase, this form is a valid color in CSS: |
The ARGB order is specifically used for legacy DirectShow filters in Internet Explorer. Supporting both also makes it directly impossible to know whether a literal My advice: drop the ARGB color support. You would only ever need it for stone-age IE browsers that are long out of commission. |
We don't test support on anything less than IE11, so this is a good idea. |
@rjgotten Are there any other function candidates (or features) for deprecation? I'm still confused why anyone would ever need to write a color as a string in Less and then convert it to a color using the |
The only thing I can imagine is automated extraction scenarios. A quite profound edge case, I think. |
@rjgotten Unfortunately I couldn't find any history in the issues that explained where it came from. |
I've updated the |
Catching up, I'm on board. The |
Updated to less@3.7.1 after which colors opacity with render as
background-color: #55555599; --> #55555599 99; (not valid)
background-color: #5559; --> #5559 9; (not valid)
The text was updated successfully, but these errors were encountered: