Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-color-5] Nested relative colors #7963

Closed
cdoublev opened this issue Oct 27, 2022 · 3 comments
Closed

[css-color-5] Nested relative colors #7963

cdoublev opened this issue Oct 27, 2022 · 3 comments
Assignees
Labels
css-color-5 Color modification

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Oct 27, 2022

3. Relative Color Syntax does not define whether nested relative colors are allowed, eg. hsl(from rgb(from var(--brand-yellow) calc(r - 100) g b) h calc(s - 10%) l), and I do not see any example of this in the spec.

Is it fine to assume that this is allowed and that you will later define a maximum of 32 level of nestings, like for math functions?

#3462 addressed maximum parentheses (function and simple block) nestings but only resolved on defining a minimum for calculations.

@svgeesus
Copy link
Contributor

Ah, I see the problem. The RCS productions in CSS Color 5 are linking to the definition of <color> in CSS Color 4 (which does not include RCS).

Yes, if <color> includes rgb() and

rgb( [ from <color> ]? [ <number> | <percentage> | none]{3} 
     [ / [<alpha-value> | none] ]?  )

then nesting is possible (and intended).

We haven't yet discussed a limit on the degree of nesting.

@LeaVerou
Copy link
Member

Yeah, RCS, as well as things like color-mix() or contrast-color() all produce <color> values, so any <color> value could use them.

@svgeesus svgeesus self-assigned this Jan 17, 2023
@svgeesus
Copy link
Contributor

c17a10d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-color-5 Color modification
Projects
None yet
Development

No branches or pull requests

3 participants