-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Refactor the hooked blocks plugins UI to not use flex-direction row-reverse #63094
Comments
The From a quick look, here are the styles that are overriding the component's behavior: gutenberg/packages/block-editor/src/hooks/block-hooks.scss Lines 2 to 15 in 7b73a72
From the components' point of view, we can't really prevent consumers of the components to apply style overrides — which we always recommend against, especially if the style overrides use internal This feels like something that should be rather discussed with @WordPress/gutenberg-design |
I think this can be attributed in part to the lack of modularity in |
Imo, components should allow 'layout variants' in very very limited cases. Ideally, they should not. |
One more consideration about icons usage in the current UI. I'm not sure using icons is ideal in the first place. |
Description
See
#52969
#54029
In #63081 a new Stylelint custom rule is added to prevent the usage of the
flex-direction
CSS property valuesrow-reverse
andcolumn-reverse
values.For more details about why this is a problem for accessibility and the very limited cases where these values can be used, please see #63048 and #61241
The UI for the hooked blocks toggles uses row-reverse. By doing so, it alters the meaning and interaction of the toggle labels and the toggles themselves. This is not OK for accessibility.
Also importantly: base component should not be altered with local implementations or CSS overrides.
The base component are designed, built, and tested with accessibility in mind. Or, at least, they aim to be as accessible as possible. Instead, it appeaers the implementation of this UI in #52969 and #54029 didn't take accessibility into consideration enough, neither the PRs had any accessibility label.
Local ad-hoc implementations and overrides also introduce UI inconsistencies that don't help providing an overall cohesive and consistent user experiences. In most of hte cases they just add cognitive load. Not to mention maintenances cost in the long term.
This UI needs to be refactored to not use
row-reverse
. To my understanding, it was used only to allow the addition of icons representing the plugins in the UI. I'd argue those icons add a little value. They're not necessary and they break the toggles in terms of expected design, consistency, usability, and accessibility.From a semantics and accessibility perspective, the toggles are, under the hood, inputs of type
checkbox
. The expectation is to have the input on the left and the label on the right. Additionally, the unnecessary spacing between the label on the left and the toggle on the right doesn't help users who use screen magnifiers.Cc @WordPress/gutenberg-components
References:
Anyone interested in understanding why, historically, labels for input fields are placed before the field and labels for checkboxes and radio buttons are placed after, may want to have a read at https://www.w3.org/WAI/WCAG22/Techniques/general/G162.html
Step-by-step reproduction instructions
flex-direction: row-reverse;
set on their container.Screenshots, screen recording, code snippet
The highlighted toggles in the screenshot below are the ones with their order altered with
flex-direction: row-reverse;
.Notice the design inconsistency with the default toggle above in the panel.
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: