Skip to content

Instantly share code, notes, and snippets.

@jasondmoss
Forked from ffoodd/improved-sr-only.markdown
Last active December 10, 2019 03:59
Show Gist options
  • Save jasondmoss/2556ee9fbff5cb72464caa248d3fe57e to your computer and use it in GitHub Desktop.
Save jasondmoss/2556ee9fbff5cb72464caa248d3fe57e to your computer and use it in GitHub Desktop.
Text meant only for screen readers
.reader,
.sr-only,
.text-assistive {
clip: rect(0 0 0 0);
overflow: hidden;
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
white-space: nowrap;
&:active,
&:focus {
clip: auto;
overflow: visible;
position: static;
width: auto;
height: auto;
margin: 0;
white-space: normal;
}
}
/* <> */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment