-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add missing formats to color spaces #435
Conversation
Some color spaces couldn't be parsed because they didn't have any formats.
✅ Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for working on this!
In general, as an API Design principle, I think boilerplate should be avoided. It makes for annoying DX, increases the chance of errors, and makes it harder to change things. Software is much better than humans at generating repetitive structures; therefore any boilerplate needed should be generated automatically by the software.
How dies this apply here? So, I think we should handle this a bit differently (which is how I thought it was handled, and maybe it was and it broke at some point): Every color space, automatically, gets a color()
format supporting a dashed ident and/or ident for the color name plus <number> | <percentage>
for the coords (or <percentage> |
, I'm fine either way). Authors can still specify
color` formats explicitly, and they will override this but we should not risk having color spaces with no formats because an author forgot to include this.
What do you think?
That's similar to an idea I've had for a while which is the |
That would not be spec compliant as it's unlikely for |
We allow a |
@lloydk I think so (together with a custom function), but we should discuss in a new issue. |
Closed, replaced by #439. |
Some color spaces couldn't be parsed because they didn't have any formats.
Added formats for:
I used a dashed-ident for all of the spaces above similar to #430.