Re: [csswg-drafts] [css-color-4] Specified value for color when calc() is used (#8318)

> The basic answer is "simplify as much as you can at each stage (specified, computed, used) and then serialize what you've got", with the caveat that if the tree simplifies down to a plain numeric value it's serialized with a calc() around it if it's a specified value (to maintain clamping behavior).

That seems fairly clear (and implies that Safari and Firefox are wrong here and should change). I can add some examples of serializing specified and computed values using calc to CSS Color 4 and 5, but the normative reference would be CSS Values.

The part about maintaining clamping behavior is less clear. If I have

`rgb(127 255 0 / calc(75% + 75%))`

does the specified value serialize as `rgb(127 255 0 / calc(100%))` or `rgb(127 255 0 / calc(150%))`? I would have assumed early clamping of the over-range alpha value.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 17 January 2023 12:34:38 UTC