Created
May 25, 2021 18:58
-
-
Save dbjorge/9cbc74299092bbba4e33e3d2d47766a0 to your computer and use it in GitHub Desktop.
sr-only color-contrast false positive repro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html lang="en"> | |
| <head> | |
| <title>sr-only color contrast false positive</title> | |
| <style> | |
| .sr-only { | |
| position: absolute; | |
| width: 1px; | |
| height: 1px; | |
| margin: -1px; | |
| padding: 0px; | |
| border: 0px; | |
| overflow: hidden; | |
| } | |
| .low-contrast { | |
| background-color: #ffffff; | |
| color: #dddddd; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <h1>sr-only color contrast false positive</h1> | |
| <p>Below this paragraph is an element styled as <code>sr-only</code> (<code>#repro</code>) which is incorrectly reported as a color-contrast violation.</p> | |
| <span id="repro" class="sr-only low-contrast"> | |
| screen reader only text | |
| </span> | |
| <p>axe-core would ideally understand that the combination of CSS used by the .sr-only class results in the text being invisible.</p> | |
| </main> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment