Skip to content
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

Make the custom CSS validation message accessible #56437

Closed
afercia opened this issue Nov 22, 2023 · 0 comments · Fixed by #56690
Closed

Make the custom CSS validation message accessible #56437

afercia opened this issue Nov 22, 2023 · 0 comments · Fixed by #56690
Assignees
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

Comments

@afercia
Copy link
Contributor

afercia commented Nov 22, 2023

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:

Screenshot 2023-11-22 at 13 57 50

This information is not accessible. Quoting from #56082 (comment)

  • No audible feedback is provided.
  • The icon is just an SVG icon wrapper in a focusable div element.
  • The focusable div element has no labeling and no ARIA role, it's just a silent tab stop.
  • It should not be a focusable div in the first place.

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

  • Go to the Site editor > Styles > More > Additional CSS
  • Add this in the Additional CSS textarea: body {background: red;}
  • Save.
  • Edit the textarea again and remove the closing bracket }.
  • Move focus away from the textarea.
  • Observe a red icon appears at the bottom right of the textarea.
  • Observe there is no audible feedback for screen reader users.
  • Observe the red icon provides a some meaningful information only when hovered or focused.
  • Observe the red icon is within a focusale <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

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Block editor /packages/block-editor labels Nov 22, 2023
@afercia afercia changed the title Make hte custom CSS validation message accessible Make the custom CSS validation message accessible Nov 22, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant