axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

False positive color-contrast: ignore purely decorative text

Open straker opened this issue 6 months ago • 0 comments

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 avatar Apr 18 '25 14:04 straker