39 lines
828 B
SCSS
39 lines
828 B
SCSS
// sass-lint:disable no-important
|
|
|
|
// visually-hidden()
|
|
//
|
|
// Make an element visually hidden, but accessible to screen readers, etc.
|
|
// @see http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
|
@mixin visually-hidden {
|
|
position: absolute !important;
|
|
height: 1px;
|
|
width: 1px;
|
|
overflow: hidden;
|
|
clip: rect(1px, 1px, 1px, 1px);
|
|
word-wrap: normal;
|
|
}
|
|
|
|
// visually-hidden--off()
|
|
//
|
|
// Turns off the visually-hidden effect.
|
|
@mixin visually-hidden--off {
|
|
position: static !important;
|
|
clip: auto;
|
|
height: auto;
|
|
width: auto;
|
|
overflow: visible;
|
|
}
|
|
|
|
// visually-hidden--focusable()
|
|
//
|
|
// Makes an element visually hidden by default, but visible when receiving
|
|
// focus.
|
|
@mixin visually-hidden--focusable {
|
|
@include visually-hidden;
|
|
|
|
&:active,
|
|
&:focus {
|
|
@include visually-hidden--off;
|
|
}
|
|
}
|