Skip to content

Instantly share code, notes, and snippets.

@1Copenut
Last active September 15, 2021 14:26
Show Gist options
  • Save 1Copenut/ee977bd0e13d8a79c75b8dee6545256e to your computer and use it in GitHub Desktop.
Save 1Copenut/ee977bd0e13d8a79c75b8dee6545256e to your computer and use it in GitHub Desktop.
a11y - CSS - Visually hidden, screen reader accessible text
/*
* 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