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

Inserter: Patterns and Media selected items insufficient color contrast ratio #55730

Open
afercia opened this issue Oct 31, 2023 · 2 comments
Open
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Needs design efforts. [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Oct 31, 2023

Description

When selecting a Pattern or a Media category in the inserter, the category item is in a 'selected' state and an additional panel opens.

Semantically, the categories are a list with list items. The currently selected item does have a aria-current="true" attribute. So far so good.

However, visually, the selected state is only communicated by the means of:

  • A subtle almost unnoticeable background color change.
  • A subtle text color change.

As such, it is very hard to visually distinguish the currently selected category. As this is an user interface control, the different state should be communicated with a color change that has at least a 3:1 contrast with the adjacent colors. Alternatively, a shape with 3:1 contrast could work.

Screenshot of Patterns catgories:

Screenshot 2023-10-31 at 10 19 55

The Patterns selected category name is repeated in the additional panel. That helps, but still the selected category can't be visually distinguished in the categories list.

Screenshot of Media categories:

Screenshot 2023-10-31 at 16 21 41

The Media category name is not repeated in the additional panel

Step-by-step reproduction instructions

  • Edit a post (or go to the Site editor)
  • Open the inserter
  • Click the Patterns tab or the Media tab
  • Select one of the categories
  • Observe the selected category is visually indicated only by the means of a slight colors change

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 Oct 31, 2023
@talldan talldan added the Needs Design Needs design efforts. label Nov 1, 2023
@joedolson
Copy link
Contributor

This is very similar to #51582; we should probably use that pattern consistently.

@joedolson
Copy link
Contributor

This would be a good example of something that belongs in design system documentation; we should be able to easily standardize these types of design decisions. See #53615

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). Needs Design Needs design efforts. [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants