-
Notifications
You must be signed in to change notification settings - Fork 143
[css-properties-values-api] Computed values for <color> #247
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
@tabatkins and I ran into currentColor in #133 as well. If I understood correctly currentColor now specified to be an actual color at used-value time. |
The computed value of
|
Then is currentColor considered "computationally idempotent" in terms of the initialValue parameter? |
There's a problem here.
You could just add color to the list of sensitivities in registerPaint, but that seems like a bit of a hack given that currentcolor is valid all over the shop. Would it make sense to special-case currentcolor instead? This would require --background-color to be registered as a color property. |
Yes, I think we should bite the bullet and special-case currentcolor. It's used as the initial value of a bunch of properties already (border-color, text-decoration-color, etc), and there's definitely custom property use-cases that want the same thing. |
(Note this also applies for line-height and custom layout) |
My current definition actually captures this correctly:
"currentcolor" as a specified value becomes "currentcolor" as a computed value, no extra information necessary (or it becomes #000 for 'color', same deal). It's not until used-value time that extra information is pulled in to resolve it into something different. |
Section 2.4 of the spec says:
For <custom-ident>, ident, <color>, <image>, <url>, <integer>, <angle>, <time>, <resolution>, <transform-function> or "*" values, the computed value is identical to the specified value.
But what if a color value is currentColor, or a color name like red?
css-color level 4 says that the computed value of the color property is an RGBA color.
Should the computed value of a variable with type
<color>
be an RGBA color as well?The text was updated successfully, but these errors were encountered: