Re: [csswg-drafts] [css-color-5] Clarification on how `channel keywords` with multiple specified types work (#7876)

> I think this is a case of the editors not appreciating the impact of other changes. At the time it was introduced to CSS, CIE L was a `<number>` in [0..100]. Then it became a mandatory `<percentage>` for a long time, and relatively recently became `<percentage>` | `<number>`. You are right that this means RCS no longer defines what you actually calculate with for `calc()` inside RCS.

Yeah, [this appears to have been some sort of mass change](https://github.com/w3c/csswg-drafts/commit/102f3c3a8c9a273d6ab7db046341a92b13d1307d).

> Following the advice that @LeaVerou gives in her CSS Variables talks:
> 
> > converting a number to a value with units is easy, `calc(var(--foo) * 100%)`
> > converting a value with units to a number requires things like `calc(var(--foo) / 1%)` which don't exist yet
> > so make your custom properties be pure data with no units
> 
> Then I suggest resolving this such that `<percentage>` gets resolved to `<number>` because that will be the most convenient thing to manipulate in `calc()`

As a general principle, we should not be designing the language long-term based on short-term limitations.
However, I don't see anything wrong with erring on `<number>` whenever possible, to limit the number of conversions needed. That could be a general principle for RCS.

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


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

Received on Thursday, 13 October 2022 17:16:55 UTC