Re: [csswg-drafts] [css-color-5] Behavior of `none` in relative color syntax (#10151)

I am unsure if preserving as `calc(none + 20)` is useful or even possible. But I might be wrong here :)

---------

If we want to preserve `none` as much as possible before calculations then I think these cases are of interest:

No calculation, only a channel keyword:
`hsl(from hsl(none 50% 50%) h s l)`

Calculation:
`hsl(from hsl(none 50% 50%) calc(h + 30) s l)`

Calculation where `none` already has meaning:
`hsl(from hsl(130deg 50% none) h clamp(10, s, l) l)`

Explicit `none` in a calculation:
`hsl(calc(none + 30) 50% 50%)`

Explicit `none` in a calculation outside of colors:
`calc(none + 30)`

_None of these make a lot of sense when written hard coded like this, but imagine a lot of indirection with custom properties._

One option could be to preserve `none` when there isn't any calculation.
Only when channel keywords are used in a math expression are they cast to numbers.

Then `hsl(from hsl(none 50% 50%) h s l)` would be equivalent to `hsl(none 50% 50%)`.
All other examples would treat `none` as `0`. 

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


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

Received on Friday, 12 April 2024 06:28:02 UTC