Make the custom CSS validation message accessible #56437
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Splitting this out from #56082 (comment)
In the global styles > advanced panel, users can enter custom CSS. When the CSS is invalid, a vaiidation message is provided by the means of a red icon with a tooltip. Screenshot:
This information is not accessible. Quoting from #56082 (comment)
div
element.div
element has no labeling and no ARIA role, it's just a silent tab stop.I disagree with the design feedback provided in #47132. Instead of adopting single-use 'ad hoc' design inspired to other tools (Codepen in this case), we should just reuste the editor components. They aim to be accessible and reusable, whilc 'ad hoc' designs defeat the purpose of usability, accessibility and maintenance. I'd argue ad-hoc implementations also defeat the purpose of reusable components in the first place.
The error message should simply use a standard notice / warning, which has been designed to provide information in an accessible way.
Also, whjn fixing this, some E2E test should be added to make sure the message works as intended, to avoir future regressions like #56082
Step-by-step reproduction instructions
body {background: red;}
}
.<div>
element that is not labelledd and has no ARIA role.Screenshots, screen recording, code snippet
No response
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: