Skip to content

False positive color-contrast: ignore purely decorative text #4755

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

Open
straker opened this issue Apr 18, 2025 · 0 comments
Open

False positive color-contrast: ignore purely decorative text #4755

straker opened this issue Apr 18, 2025 · 0 comments
Labels
fix Bug fixes rules Issue or false result from an axe-core rule support
Milestone

Comments

@straker
Copy link
Contributor

straker commented Apr 18, 2025

Text that is decorational should not need to pass color-contrast. The main problem is figuring out how to detect that text is decorational. Color-contrast purposefully does not exclude hidden elements, so adding aria-hidden to the element does not exclude it from running. This is intentional as hidden from screen readers is not the as as hidden from visual users.

We need to figure out how best to either determine the text is decorational or a better way to markup the element to let us know it's decorational.

<div style="background: #d4e9e2; padding: 10px">
  <p style="color: white">Decorational text</p>
</div>
@straker straker added fix Bug fixes rules Issue or false result from an axe-core rule support labels Apr 18, 2025
@straker straker added this to the Axe-core 4.11 milestone Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rules Issue or false result from an axe-core rule support
Projects
None yet
Development

No branches or pull requests

1 participant