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] comma-separated syntax clarification #4738

Closed
jonathantneal opened this issue Feb 4, 2020 · 3 comments
Closed

[css-color-5] comma-separated syntax clarification #4738

jonathantneal opened this issue Feb 4, 2020 · 3 comments
Assignees
Labels
Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-5 Color modification

Comments

@jonathantneal
Copy link
Contributor

First, thank you so much to everyone continually imagining these color functions for CSS. ❤️

Would you help me understand the syntax for color-adjust()?

color-adjust() = color-adjust( <color> [ [=color-functions|color-function=] <colorspace>? ]?] )
  1. What does the U+003D EQUALS SIGN (=) mean in this syntax?

  2. Will color-adjust() receive a comma-separated list of values, as seen in Example 8?

color-adjust(peru, lightness(-20%));
  1. Would the answers these questions also apply to color-mix() and color-contrast()?

Additional Background: Based on that comma-separated example, I may have expected [=color-functions|color-function=] to instead read as <color-function># (syntax reference). I would love the opportunity to better understand these syntax definition things in general.

@svgeesus svgeesus self-assigned this Feb 4, 2020
@svgeesus svgeesus added css-color-5 Color modification Needs Edits labels Feb 4, 2020
@svgeesus
Copy link
Contributor

svgeesus commented Feb 4, 2020

  1. What you are seeing is an attempt to use the Bikeshed (our spec preprocessor) autolink syntax with alternate link text. It hasn't worked, which is why you are seeing what you see. Had it worked, you would see
color-adjust() = color-adjust( <color> [ color-function <colorspace>? ]?] )

and color-function would be a link to the list of color functions.

  1. The comma between peru and lightness is an error in the example. Those two are not alternates so should not use a comma. It will be possible to use multiple functions, but they are also not alternates so won't use a comma either.

(BTW this is why CSS Color 4 dropped the commas in, for example, rgb(r%, g%, b%) compared to CSS Color 3 and earlier)

  1. color-contrast take a comma-separated list of alternates as the second argument. For color-mix see color-mix to allow more than two colors?

@svgeesus
Copy link
Contributor

svgeesus commented Feb 4, 2020

c30f441

@jonathantneal
Copy link
Contributor Author

Thanks @svgeesus. I consider all my questions answered and this resolved. 👍

On a related note, I’ve submitted a PR to align some remaining legacy comma syntax. #4746

Thanks again, and thank you and all of the editors so much for your efforts here.

@svgeesus svgeesus added Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. and removed Needs Edits labels Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-5 Color modification
Projects
None yet
Development

No branches or pull requests

2 participants