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

feat(css): Add missing css color() function #858

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

skyclouds2001
Copy link
Contributor

@skyclouds2001 skyclouds2001 commented Dec 26, 2024

Description

this feature is supported in all major platform per bcd

some test log in chromium:

CSS.supports('color','color(from hsl(0 100% 50%) xyz calc(x - 0.3) calc(y + 0.3) calc(z + 0.3) / calc(alpha - 0.1))')
true
CSS.supports('color','color(from hsl(0 100% 50%) srgb calc(r - 0.4) calc(g + 0.1) calc(b + 0.6) / calc(alpha - 0.1))')
true
CSS.supports('color','color(from hsl(0 100% 50%) srgb calc(r - 0.4) calc(g + 0.1) calc(b + 0.6) / none)')
true
CSS.supports('color','color(display-p3 0.3804 0.9921 0.1412)')
true

Motivation

Additional details

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color
https://drafts.csswg.org/css-color-5/#funcdef-color
https://drafts.csswg.org/css-color/#funcdef-color

Related issues and pull requests

reported in #819

since this is the last case that not done in #819, so closes #819

@skyclouds2001 skyclouds2001 marked this pull request as ready for review December 26, 2024 07:49
@skyclouds2001 skyclouds2001 requested a review from a team as a code owner December 26, 2024 07:49
@skyclouds2001 skyclouds2001 requested review from bsmth and removed request for a team December 26, 2024 07:49
@bsmth
Copy link
Member

bsmth commented Jan 7, 2025

Nice, thank you. This is referencing module level 5, correct?

https://drafts.csswg.org/css-color-5/#color-function

@skyclouds2001
Copy link
Contributor Author

Nice, thank you. This is referencing module level 5, correct?

https://drafts.csswg.org/css-color-5/#color-function

Yes!

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for module level 5. It feels like we're missing some member that describes the spec level the syntax targets, but again, that's for another day. Thank you!

@bsmth bsmth merged commit 397906c into mdn:main Jan 8, 2025
3 checks passed
@skyclouds2001 skyclouds2001 deleted the color() branch January 8, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missed syntaxes in 2.13.0
2 participants