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
- Add a Buttons block
- Select the Button
- In the sidebar, edit the text & background colors
- No color combo, even using the same color for both, will show the contrast warning
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:
| Paragraph |
Button |
 |
 |
Environment info
- WordPress 5.9.1
- Gutenberg 12.7.0 (also reproduced on GB trunk, core without Gutenberg, and in GB 11.9.0, trying to see when this was introduced)
- MacOS, Chrome & Firefox
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
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
ColorPanelto 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