Skip to content

[css-color-5] Does relative colors support current color? #9238

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

Closed
tiaanl opened this issue Aug 24, 2023 · 5 comments
Closed

[css-color-5] Does relative colors support current color? #9238

tiaanl opened this issue Aug 24, 2023 · 5 comments
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-color-5 Color modification

Comments

@tiaanl
Copy link
Contributor

tiaanl commented Aug 24, 2023

The origin color for the relative color syntax takes a <color> so I assume that includes the currentcolor keyword. I don't see a specific mention of this, in the spec but according to wpt (and the implementation in WebKit) currentcolor is not tested/supported.

Most notably if it is supported I guess we should be able to serialize the relative syntax as rgb(from currentcolor r g b) and not an already computed color.

@tabatkins
Copy link
Member

Yup, currentcolor is a <color> so it should work. If we're lacking tests, that's something that should be fixed.

@tabatkins tabatkins added the css-color-5 Color modification label Aug 25, 2023
@Loirooriol
Copy link
Contributor

From https://drafts.csswg.org/css-color-5/#resolving-rcs

Otherwise (if currentColor was used in the function), the computed value is the Relative Color Syntax function with each <color> parameter resolved according to CSS Color 4 §  14. Resolving <color> Values, thus preserving inheritance into child elements.

nested-color-mix-with-currentcolor.html is listed as a test, but it's about color-mix(), so it should be in https://drafts.csswg.org/css-color-5/#resolving-mix instead?

@svgeesus
Copy link
Contributor

parsing/color-computed-relative-color.html does not test currentColor, and should. Same for parsing/color-valid-relative-color.html

@svgeesus
Copy link
Contributor

nested-color-mix-with-currentcolor.html is listed as a test, but it's about color-mix(), so it should be in https://drafts.csswg.org/css-color-5/#resolving-mix instead?

Yes, it should.

@svgeesus
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-color-5 Color modification
Projects
None yet
Development

No branches or pull requests

4 participants