-
Notifications
You must be signed in to change notification settings - Fork 717
[css-images-4] Unclear serialization for cross-fade #9772
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
It would make sense for serialization to be consistent with color-mix() imo |
Is this for serializing the specified value or the computed value? For the former, percentages can be omitted so they won't be in the serialization. For the latter:
but (presumably at used-value time)
So I guess the serialized computed value includes those divided-equally percentages, and maybe the spec is trying to say that? |
So if the stylesheet has BackGround-Image: cRoss-fAde(50% #0f0, #000); the specified value would be serialized as "cross-fade(50% rgb(0, 255, 0), rgb(0, 0, 0)" (ASCII-lowercase, single spaces, hex colors become |
It doesn't say as far as I can see, so it would be good to have both specified if they are to be different.
The problem is that you have two different sets of the percentages. Some values can be ignored when computing the size, but not the alpha, so there are effectively two different computed values. And if you specify something like |
All good points, so the serialization should probably talk about whether the values can be fully resolved or not as well. Another example: cross-fade(30% red, currentColor); as @nt1m said, following |
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.csswg.org/css-images-4/#serialization says: “For cross-fade(), always serialize the <percentage>.”
What does “the” percentage refer to? There can be multiple ones, and they can explicit and implicit. (In the old -webkit-cross-fade(), there used to be only one, so perhaps it is a remnant?) If a percentage is implicit, should it be serialized? (This is not always possible for the specified value, as some percentages may be unknown until computed value time, or even used value time if sign() etc. is involved—furthermore, they can be different for sizing and fading.) Perhaps “always” should be moderated somewhat.
The text was updated successfully, but these errors were encountered: