[css-color-4] Clarify that `none` is allowed in calculations

Open
#13,752 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
css

Research direction

Review the relative color syntax passages quoted in the issue and the discussions in #10151, #10211, and #10280. Check the current WPT coverage and the noted browser behavior before determining what the CSS Color 4 text should clarify. Done means the specification's treatment of none in calculations is unambiguous and any needed tests or examples are addressed.

Written by the indexing model from the issue text.

Description

css-color-4

Discussions and resolutions in #10151, #10211, #10280, suggest that none is allowed in calculations in color functions, with examples explicitly using none inside a math function, which seems unspecified, as opposed to RCS component keywords (emphasize added):

If an origin color is specified, the remaining arguments can either be specified directly, as normal, or be specified as a component keyword referring to one of the components of the origin color converted to the color space of the relative color. Math functions can also use these keywords to do dynamic modifications of the origin color’s components.

Within a relative color syntax rgb() or rgba() function, the allowed component keywords are:

  • r, g, and b [...]
  • alpha [...]

This does not seem to be backed by any test on WPT, or supported in current versions of Chrome and FF (ESR).

Of course, if a relative color uses a math function containing a component keyword representing a channel value of the origin color that is specified with none, resolving the math function will require resolving none. But this does not imply allowing it in calculations, as long as it does not show up in the serialization of the resolved color value (the declared color value preserves the specified component keywords).

And I do not see how allowing it can be useful to authors.

Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.