Skip to content

Instantly share code, notes, and snippets.

@l4ci
Created January 9, 2018 10:15
Show Gist options
  • Save l4ci/7cdbc2011ee0d56b7fc3d2101ca0288b to your computer and use it in GitHub Desktop.
Save l4ci/7cdbc2011ee0d56b7fc3d2101ca0288b to your computer and use it in GitHub Desktop.
<a class="skip-link sr-only sr-only--focusable" href="#content">Skip to content</a>
// Screen readers only
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
overflow: hidden;
clip: rect(0,0,0,0);
white-space: nowrap;
clip-path: inset(50%);
border: 0;
&--focusable {
&:active,
&:focus {
position: static;
width: auto;
height: auto;
overflow: visible;
clip: auto;
white-space: normal;
clip-path: none;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment