Re: [csswg-drafts] [css-color-adjust-1] Is forced background-color computed or used value? (#4915)

It would be a little weird if all the other forced-color effects are available at computed time, but background-color is naively reported without adjustments.

> It has to be at used-value time, due to the system color keywords not resolving until then

Yes, but the other colors at least compute correctly to a system color.

Ideally, we would define the computed value of background-color using one of the Colors Level 5 mixing functions: this system color, but adjusted to use that alpha.

> the computed value of background-color must be computed to know the author alpha. We shouldn't then suddenly redefine the computed value after it has already been determined

This is also true, and trickier to work around.

Logically, we want to treat `background-color` as if it is a shorthand for `background-color-color` and `background-color-alpha`. The author computed `background-color` sets both of these hypothetical longhands, and then the forced user agent style overrides the first but not the second. Using that shorthand/longhand model, the overriding would happen at computed value time.

A comparison would be `font: caption; font-size: 16px`. There is no way to serialize a `font` shorthand representing the combined result without first substituting the expanded value of the system font keyword.

But of course, the difference is that system fonts _are_ substituted at computed time, and they _do_ have longhand properties that can inherit only part of that value. So, I'm not sure we can reuse that model without a serious re-think to all this.




-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4915#issuecomment-623529609 using your GitHub account

Received on Monday, 4 May 2020 15:23:00 UTC