-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support RRGGBBAA / RGBA hex colors #2179
Comments
According to Fyrd/caniuse#2249, it looks like this has already landed in some browsers, so we should support it ASAP. |
Thanks nex3! |
Hmm, this is technically a breaking change. CSS defines an ID as a valid declaration value in the basic user interface module, so Sass already parses tokens like I'm leaving this tagged as 3.5 because we should get the deprecation warning in place before we release. |
We also won't support colors like |
@nex3 Any updates? |
This has landed and been released in 3.5. |
@nex3 I've updated to 3.5.1, and I'm still receiving the warning that it's parsed as a string, not a color. It's not just that the warning hasn't been removed, it's being copied verbatim into the compiled code (i.e. not turned to rgba) |
Oh, sorry, you're right. This is waiting on 3.6, because we need to have a release's worth of deprecation for the existing string parsing. |
@nex3 Just an FYI it landed in Chrome 61 today. |
Any news for that feature ? 3.6 landing ? |
Sounds like we've done a solid deprecation cycle now... time to get this into master! |
For me, parsing "#xxxx" as a string identifier is valid, but RGB(A) colors specified using these strings should be valid: strings are already parsed to know if they match a color name or some known patterns of #ID to see if they can ba unambiguously converted to a color type: this is a case similar to a conversion constructor. Basically CSS does not need to have a specific and distinctive token type for colors, it just has to recognize known "name" or "#ID" or "functionname( parameters )" to see what they designate. It's not to do at token level (i.e. lexer). Color specifiers will continue to have some new forms in the color module, but the basic syntax is still stable, and each identifier is then queried to see if they can match some type constructor and then have some distinctive relevant properties that allow combining them or not. |
This adds specs for both the deprecation behavior and the eventual post-deprecation behavior. See sass/sass#2179
Also support unambiguous hex alpha colors. Closes #360 See sass/sass#2179
Also support unambiguous hex alpha colors. Closes #360 See sass/sass#2179
Also support unambiguous hex alpha colors. Closes #360 See sass/sass#2179
Edited by @nex3
Specs: sass/sass-spec#1262
Tracking issues:
SASS version: 3.4.22
Example:
Error display:
Same error is shown if 4 digits are used (e.g.
#0008
) or if its used inside radient-gradient().The text was updated successfully, but these errors were encountered: