-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
852 color widget #4437
852 color widget #4437
Conversation
Added Color Widget + Color Widget Documentation and added Color Fields to Kitchen Sink
21f165b
to
221937c
Compare
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.
@felixboet this is amazing. Works very well.
Thank you for scoping it down for simplicity.
My changes were mostly about extracting some divs
into smaller components to make the render
method shorter.
Also, added very small clarifications to the docs.
thanks @erezrokah ... much cleaner that way :) I realised one little thing from my code I am not happy with. Clicks outside the color picker are handled by the fullscreen "ClickOutsideDiv" to close the color picker. That means if you opened the color picker and want to edit another field, you have to click twice, once for closing the picker, and then for the other field. That is not consistent with other widgets like "select" or "datetime", where you can click immediately from one field to another. I guess it's quite easy, but I don't have the experience for a quick solution... Would you like to take care of that? |
Sure, how about opening a new issue for that so we can track it? |
... and I think the widget has to be renamed, because netlify-cms-widget-color already exists ... My proposal: netlify-cms-widget-colorstring / ColorString |
Damn, forgot about that. Thank you for reminding me. so |
Ah, you merged already. Awesome :) ... ok, i open an issue |
Fixes #852
A basic color widget - it's a version of my color-picker-widget reduced to just use the "chrome" picker, demo here (field 1&2). I could also include more or all color pickers, but I think it's nice to keep it simple as the standard color picker.
It uses react-color for the color picker and validate-color to validate the string for the color swatch and display a "?" if it's not a valid color string.