Re: [csswg-drafts] [css-color] Resolving color-mix() (#7302)

> > Another open question: what should we do for negative `calc` values?
> 
> This is not something that needs to be defined specifically for `color-mix()`, it's the same handling as any other property or function that only allows positive numbers, e.g. `padding` or `<border-radius>` in `inset()`.

Yes, this is generally covered by the css-values spec which says e.g. calc(-10%) should not be invalid at parse/specified time here even if negative percentages are not allowed, but should be clamped to the allowed range at computed value time.

There is one tricky part that I'm not sure if we have for other properties, and that is that color-mix() can be invalid even when both percentage values are separately within the allowed range. If you have two negative percentages (or 0%), and they are clamped at computed value time, you will end up with two 0% values which is still invalid per spec.


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


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

Received on Friday, 14 October 2022 18:58:53 UTC