Skip to content

Instantly share code, notes, and snippets.

@CITguy
Created April 29, 2020 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CITguy/57e0d9f4b96ff6942299a78c4f669c8c to your computer and use it in GitHub Desktop.
Save CITguy/57e0d9f4b96ff6942299a78c4f669c8c to your computer and use it in GitHub Desktop.
@mixin visuallyHidden {
// remove external box decoration
border: 0;
outline: none;
box-shadow: none;
// shrink as small as possible without removing
// content from the accessibility tree
width: 1px;
height: 1px;
// eliminate any space being taken up by the element
margin: -1px;
overflow: hidden;
padding: 0;
// remove element from normal document flow
position: absolute;
z-index: -10000;
// render fg and bg invisible
color: transparent;
background-color: transparent;
text-shadow: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment