-
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
Accessibility: Fix custom color palette #62753
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Can I ask that we provide testing information that uses the names of things as they're exposed in the editing environment? There's nothing literally called "Global Styles" in the editor, so it's difficult for outside users to make use of those instructions to locate the item to be tested. I believe this is referring to the color options in the Stylebook, but please confirm. |
This is definitely a significant improvement. I'd still very much like to see two changes:
|
Thanks for looking into this @ellatrix I'd agree with @joedolson that the color picker would need Cancel and Save buttons. Not sure if that can be addressed in this PR or separately, as it appears to be a broader issue with the color picker. I'd suggest two further improvements to be made, if possible, in this PR: For consistnecy, the focus style of the new button to edit custom colors should be, ideally, a circular outline. Screenshot of the two different focus styles of the color buttons: When removing a custom color by pressing the minus icon button 'Remove color', focus should be managed to avoid a focus loss. I'd think the only reasonable place to move focus to would be the plus icon button 'Add color'. |
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.
Please see last comment.
I can check again later today. I'd like this PR to be included in RC1, so it should be ready today, but I have a few other things to work through first. |
To me even the focus outline might be need a larger change (needing to pull in and extracting other components), so I'm not sure if it should block this improvement tbh... I went for the quick fix of wrapping the color in a Button. |
I could try to prevent the focus loss on remove though 👍 |
I'd agree it would be good to have these improvements in the RC. Further fixes can be done as follow-up in #62728 |
af26d7c
to
76111ef
Compare
@afercia I fixed the focus loss. |
Let's do this PR instead of #62698. |
76111ef
to
52e2063
Compare
@ellatrix thanks. I'm not sure the 'Done' button is the right choice though. When there's only one custom color, removing it will also make the 'Done' button disappear so in this case focus is lost anyways. |
@afercia Where do you suggest it to move? |
Although not ideal, I think the 'Add color' button is the only one that is guaranteed to be always rendered? |
I'm not sure I have time left to fix this, I need to release the editor packages asap. If not, this will slip to 6.7 |
I can try to have a look at it. |
After 262a486 focus is now moved back to the 'Add color' button when removing a color. When users This UI would need more work as there are other focus losses and room for accessibility improvements but I'd think this PR is an improvement that would be nice to have in the 6.6 release. |
Great, thanks @afercia! Could you approve the PR? I'll merge it and cherry pick it onto the release branch |
Done, thanks 👍🏽 |
There was a conflict while trying to cherry-pick the commit to the wp/6.6 branch. Please resolve the conflict manually and create a PR to the wp/6.6 branch. |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: joedolson <joedolson@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: joedolson <joedolson@git.wordpress.org>
Manually backported this in #62824 |
What?
Makes the custom color palette options more accessible. Fixes #62728, at least partly.
Why?
The current setup is very overcomplicated and buggy. There's a wrapper button which is used to "edit a color", and only on click shows the input and remove button, but instantly puts focus in an unescapable popover.
How?
onClose
function for the popover.Testing Instructions
Go to Site Editor → Styles → Colors → Palette.
Add a custom color and press Done.
Click the three dots and then "Show details".
All fields should be focusable for each button.
When editing the color, it should be possible to escape the popover.
Testing Instructions for Keyboard
Screenshots or screencast