-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ColorPalette: Improve color name readability #50450
Conversation
Size Change: +211 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7435f08. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5080901975
|
👋 @jameskoster! Requesting your expert design input! I'm basing this PR on your recommended design. Initially I've set it up to only display the new section below the color picker button if a value is present... but I don't love how it pops in and out of view, making the popover's size change when a selection is made or cleared: Screen.Recording.2023-05-11.at.13.09.03.movWould it be better to make that new section always visible, even if it's empty when no value is selected? Something like this: Screen.Recording.2023-05-11.at.13.29.57.mov |
Thanks for the ping @chad1008, I agree the jumping is not ideal. There are a couple of options we might try... First of all we might hide the white 'details area' when the color is unset, but have the transparent texture occupy the same overall footprint. Similar to your second video just without the empty area. But I suspect that will give too much visual prominence to the texture. So perhaps this is an opportunity for us to communicate that the color is unset? In these cases, instead of the color name the label could be "No color set", and the 'value' could be "Transparent". This might even help a bit with #43082. For custom colors the label could be "Custom". What do you think? |
That's a good point. In that case, I don't suppose the |
Perfect, thanks @jameskoster |
ce694cb
to
f549a10
Compare
I definitely agree. The more I play with this component, the more that starts to bug me 😆. I don't think it's something the component can currently do, but I definitely want to defer to @mirka or @ciampo, as they've worked with it a lot longer than I have. From my understanding and work with it though, it would be dependent on the consumer passing an initial I could be wrong, but I think we might need a new prop to handle that, something like |
Co-authored-by: Marco Ciampini <[email protected]>
Fixes #48119
What?
Improve readability of the color name and value by moving it off of the color swatch.
Why?
See #48119 for more context and conversation, but in short having the text overlayed over the currently selected color can create contrast issues that are difficult to navigate due to the number of variables. One of these is that selecting a text color that will contrast well with the checkered pattern used to represent transparencies is likely going to be very difficult.
How?
By moving the color name and value down below the swatch, contrast with the color itself and the transparency pattern are no longer a concern. The only contrast we'll need to worry about is the background color.
Notes
Testing Instructions
Testing Instructions for Keyboard
ColorPalette
open in Storybook or the editor, pressTab
once to focus the picker button. Then pressEnter
/Return
to select it.Esc
to close the popoverTab
once to confirm the focus moves to the firstCircleOptionPicker
option, confirming these changes don't alter the tab sequence.Screenshots