-
Notifications
You must be signed in to change notification settings - Fork 661
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
[css-color] Are rgba()
and hsla()
functions meant to be deprecated?
#10886
Comments
Good question, and the answer is a bit more complicated than a simple yes or no. We now define a legacy color syntax, which originally was simply a comma vs space-and-slash difference. On the positive side, the legacy syntaxes are implemented widely and reach back to earlier browser versions so content developers who are required to support incredibly old browser versions for whatever reason are advised to use them. That broad support is also why we serialize in legacy syntax, using either On the negative side, there is an increasing list of things that modern color syntax can do, which legacy syntax cannot:
That list gets bigger in CSS Color 5, relative colors
And thus, for new color syntaxes that don't have a web-compat legacy, we only define the modern syntax because we expect all of these additional things to always work. Moving on to your specific questions:
Remember, deprecated means "don't use in new content" not "will stop working". So they can certainly continue to be used, even if we did deprecate them, which we have not. Provided that none of the new features are needed.
If it doesn't make a difference then yes, encourage new developers, and developers of new code, to use the modern syntax. That way, if they want to set an |
The MDN team is fairly clear that the comma-list syntax is discouraged. Our question is whether there's any reason to prefer between |
There is a slight preference for |
When serializing I'm getting the legacy comma-list syntax anyway, right? Is there any reason for this preference that's relevant to developers, or is it just for consistency with other color functions? |
The relevance is that changing the hue to missing in And also that |
I think I'm still not making myself clear. There are four ways to write colors:
Right now, we are on board with dissuading people from using 3 and 4, due to the limitations you mentioned about |
I see. No, both will work and mean exactly the same. |
While they work and mean exactly the same, I'd still say authors should be encouraged to use Maybe Sebastian |
7835149#diff-e1ef1cfacc6b46c293a73dc844f094d931e45a06d078ca40ff09b61570bc16c2L1505-L1506
The rgba() and hsla() functions are aliases for rgb() and hsl() respectively.
The text was updated successfully, but these errors were encountered: