Blocks text placeholder may have insufficient color contrast depending on the active theme #60275
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Package] Block library
/packages/block-library
[Package] Rich text
/packages/rich-text
[Type] Bug
An existing feature does not function as intended
Description
Some blocks display a placeholder text.
In all cases, the placeholder text must meet the color contrast ratio requirement of 4.5:1. It is part of the user interface so that the editor must make sure it is readable for everyone.
Turns out the color of the text placeholder may inherit from the active theme.
For the RichText, the editor CSS sets a CSS
opacity: .62;
regardless.Setting that opacity doesn't seem to be ideal. When the active theme uses a light color, the opacity set by the editor may bring the contrast ratio below the required threshold. This is the case with Twenty Twenty-Four, for example.
Iin the screenshot below, I'm comparing some block text placeholder in the editor. On the left, with Twenty Twenty-Three active and on the right with Twenty Twenty-Four active.
Observe the color of some of the placeholders actually changes depending on the theme and it has insufficient contrast.
Step-by-step reproduction instructions
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: