-
Notifications
You must be signed in to change notification settings - Fork 657
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-colors-5] Serialization of a relative color functions as component of specified values #9464
Comments
Serializing |
I guess this issue depends on these (which need to be created):
Now that Chrome 119 supports the relative color syntax (apparently), maybe CSS Values 4 (and CSS Typed OM) could specify this in determine the type of a calculation and simplify a calculation tree? |
I've slightly restructured the numeric constants section of Values 4 and added a subsection to talk about keyword variables specifically. Simplification is already well-defined - a keyword, once it has the information necessary to resolve, is handled by step 2.1, same as any other function that resolves to a numeric value. |
@svgeesus Now that I've specified precisely how variables work, you'll want to add a tiny bit more detail to Color 5 to specify that the channel keywords resolve at the same time as the source color does, so |
I think determine the type of a calculation also requires this change: - <calc-constant>: the type is «[ ]» (empty map)
+ <calc-keyword>: the type defined by the corresponding specification for the keyword In simplify a calculation tree (steps 1, 8, 9), |
I think your commit fixed this issue. Thanks! I edited my previous comment to remove questions that it answers or that the specs already answers. |
I do not expect the following to apply in a specified value:
https://drafts.csswg.org/css-color-5/#serial-relative-color
But the WPT tests do. Perhaps the intention is actually to test resolved values (
getComputedStyle()
) instead of specified values (getPropertyValue()
).In these tests, relative sRGB functions serialize as resolved
color(srgb ...)
and other relative functions serialize as the corresponding resolved function:lab(from <color> ...)
aslab(...)
,lch(from <color> ...)
aslch(...)
, etc.currentcolor
prevents resolving.Math functions are resolved whereas they are preserved when serializing an "absolute" color functions.
color-mix()
serializes as is:So I am not sure what is the expected serialized value for eg.
rgb(from color-mix(...) ...)
.If these tests are actually a work in progress, I suggest preserving the details of the value as specified by its author, and being consistent with the serialization of "absolute" color functions:
<percentage>
,<hue>
,<alpha-value>
, to<number>
, excluding in math functions, which are preserved<number>
when required<number>
representing a<hue>
in[0,360)
xyz
toxyz-d65
The text was updated successfully, but these errors were encountered: