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

Color serialization with channel keywords and calc #47921

Open
tiaanl opened this issue Sep 2, 2024 · 2 comments
Open

Color serialization with channel keywords and calc #47921

tiaanl opened this issue Sep 2, 2024 · 2 comments

Comments

@tiaanl
Copy link
Contributor

tiaanl commented Sep 2, 2024

When specifying a channel keyword in a color there are two methods:

rgb(from red r g b) and rgb(from red calc(r) calc(g) calc(b))

According to css/css-color-parsing/color-valid-relative-color.html they serialize exactly as specified, so specifying a channel keyword without calc serializes without calc and specifying with calc serializes with calc.

When a calc contains a single numerical value, the calc() part can be omitted, otherwise it should be serialized with it as per https://drafts.csswg.org/css-values-4/#calc-serialize.

Should these rules apply to channel keywords as well and how would it change the examples I gave?

@nt1m
Copy link
Member

nt1m commented Sep 3, 2024

@weinig

@tiaanl
Copy link
Contributor Author

tiaanl commented Sep 25, 2024

@svgeesus

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

No branches or pull requests

3 participants
@nt1m @tiaanl and others