Last active
September 15, 2021 14:26
-
-
Save 1Copenut/ee977bd0e13d8a79c75b8dee6545256e to your computer and use it in GitHub Desktop.
a11y - CSS - Visually hidden, screen reader accessible text
This file contains 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
/* | |
* SOURCE: | |
* Much respect to Chris Coyier of CSS-Tricks | |
* https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/ | |
* | |
* TESTED: | |
* OSX VoiceOver | |
* Windows 7 NVDA | |
* | |
* USE CASES: | |
* Sass or PostCSS mixin | |
* Standalone CSS class | |
*/ | |
.sr-only { | |
border: 0; | |
clip: rect(0 0 0 0); | |
clip-path: inset(50%); | |
height: 1px; | |
margin: -1px; | |
overflow: hidden; | |
padding: 0; | |
position: absolute; | |
width: 1px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment