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

Buttons: No color contrast warning, regardless of chosen colors #39226

Open
ryelle opened this issue Mar 4, 2022 · 1 comment
Open

Buttons: No color contrast warning, regardless of chosen colors #39226

ryelle opened this issue Mar 4, 2022 · 1 comment
Labels
[Block] Buttons Affects the Buttons Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@ryelle
Copy link
Contributor

ryelle commented Mar 4, 2022

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

  1. Add a Buttons block
  2. Select the Button
  3. In the sidebar, edit the text & background colors
  4. 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

@ryelle ryelle added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Buttons Affects the Buttons Block labels Mar 4, 2022
@annezazu
Copy link
Contributor

annezazu commented Mar 7, 2022

Possibly related: #38222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

No branches or pull requests

2 participants