Skip to content

Instantly share code, notes, and snippets.

@JoeNoPhoto
Created October 14, 2015 07:15
Show Gist options
  • Save JoeNoPhoto/56ce11a2664ac198051c to your computer and use it in GitHub Desktop.
Save JoeNoPhoto/56ce11a2664ac198051c to your computer and use it in GitHub Desktop.
Hide Element Mixin
%visuallyhidden {
margin: -1px;
padding: 0;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
clip: rect(0, 0, 0, 0);
position: absolute;
}
@JoeNoPhoto
Copy link
Author

Usage

<button class="mobile-navigation-trigger">
  <b class="visually-hidden">Open the navigation</b>
  <img src="img/mobile-navigation-icon.svg">
</button>
.visually-hidden {
  @extend %visuallyhidden;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment