Buttons: No color contrast warning, regardless of chosen colors #39226
Labels
[Block] Buttons
Affects the Buttons Block
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
Description
On the Button block, you can set a text & link color. Regardless of the colors chosen, then contrast warning does not appear. This seems to be because the node used in
ColorPanel
to get the color data is getting.wp-block-button
, when the colors are actually applied to the child div.wp-block-button__link
. So it's never getting the set colors, just whatever happens to be set on the container element.Step-by-step reproduction instructions
Doing the same with a paragraph block shows the contrast warning.
Screenshots, screen recording, code snippet
The contrast warning shows correctly on Paragraphs, but not on Buttons:
Environment info
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: