-
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: Improving accessibility and visibility #36925
Conversation
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.
Great and necessary improvements, thank you!
Pinging @jasmussen for a quick design check, especially re: the thin border on the custom color button.
Nice! Thank you for the PR. Some nice improvements here. I just opened #36998 detailing some fixes we need to do, including the addition of the basic border. However instead of creating a pseudo element to overlay the border, you should be able to just do this:
I would also echo @mirka around focus, to keep it just for focus alone. But I'd use the same focus style we use elsewhere, something like:
What do you think? Nice work! |
Thanks so much for the code and the design review!
The edge will look jagged because it overlaps the checkerboard background if Like this: This is why I added border on the pseudo-element. But there is no problem If the text is used to indicate "not set" instead of a checkerborad background as mentioned in #36998. And personally I think |
I think the jagged edge is okay because yes we do indeed need to change the transparency for the unset color. It's useful for colors that include transparency, but it's not clear enough for "unset" colors. But thank you for considering those details! |
Thank you for reply. |
I don't think this PR needs to be blocked on the color picker discussions! I think if we make the changes (inset box shadow, tweaked focus style) this PR would be an excellent step forward. I notably like the contrast checking for the overlay text. Let me know if you need any help, I'd be happy to push some tweaks to the branch. Thanks again. |
I understand ! |
If you can commit the changes to an inset box shadow and the focus style, yes, we can land this as a great improvement. The tweak to the transparent custom color card needs to be looked at separately. I hope I'll get time to do it, otherwise someone else is. You are most welcome to contribute of course, but you don't have to. What you have made here is already a big step forward, thank you! |
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.
Thanks so much for this. This looks like a good step forward: legible text on a white background, and a good focus style.
I will follow up separately on the transparency grid, but this is excellent.
I left one small note on a position relative rule, but it's nitpick territory. Thanks again.
@@ -1,7 +1,7 @@ | |||
.components-color-palette__custom-color { | |||
position: relative; |
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.
This relative position was probably needed for the abs positioned pseudo element but isn't needed anymore.
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.
Thanks for the improvements! If you could add a brief changelog entry before we merge, that would be great ✨
Okay, should I add to "Unreleased > Enhancements"? |
I think it can be considered a bug fix, but unreleased yes! Thank you |
@mirka it looks like the PHP unit test failures are related to the beta merge window. Should we just force merge it? |
I don't think I have rights to do that, but if you do, go ahead! In any case I think we'll be unblocked when #37007 lands. |
Ah, we can wait for that one. Thank you! |
@t-hamano The CI tests seem to be fixed now, could you do a final rebase? 🙏 |
I grabbed the latest commit from rebase, combined my work into one commit, and force pushed it. I'm not familiar with rebase, so please point out any inappropriate points if any...:sweat: Also, PHP unit tests passed, but one of the E2E tests got 400 error. |
I've restarted the test, let's hope it passes. Thanks again! |
Description
PR to improve the accessibility and visibility of the ColorPalette component.
I think that the new design of the
ColorPalette
component has the following three problems.#fff
, which makes the text difficult to read when a color close to white is selected.colorpalette_before.mp4
I have taken the following actions to solve those problems.
colorpalette_after.mp4
This is the first time I've had a pull request with a specific code.
Please point it out if you find anything inappropriate,
Types of changes
Improving accessibility and visibility
Checklist:
*.native.js
files for terms that need renaming or removal).