Re: [csswg-drafts] [css-color] Fallback color in @color-profile that uses RCS (#6767)

> Given that the relative color functions here would have a slightly unique syntax (no `from <color>` argument), do we really need to accept a generic `<color>` as well? I don't see how your example like `fallback-color: red;` is at all good for users of the page, but if an author _really_ wants to do it they can with `fallback-color: rgb(255 0 0)` (since that's technically a relative color function, just a constant one).

I thought it would be easier to define as a `<color>`. I wouldn't want to repeat the grammar of (relative) color functions in there. There is also no precedent of allowing only a color via functional syntax but not other syntaxes. Btw, while `fallback-color: red` is obviously bad for general usage, it can be useful for debugging.

Regarding the missing `from <color>`, I was thinking of defining the syntax in RCS, something along the lines of "When used in descriptors, in some cases the host syntax can define what the origin color would be. That case, the `from <color>` argument can be omitted. 

Alternatively, we can use a keyword (e.g. `this-color`), and use `from this-color`. Then no weird new syntax needs to be defined, though it's not a good idea to let editorial convenience drive syntax.

Alternatively, we can do both: define the keyword as a means to explain the magic, then say if the argument is `this-color`, it can be omitted.

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


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

Received on Wednesday, 27 October 2021 09:01:01 UTC