Class | Properties |
---|---|
.sr-only | @include sr-only(); |
.sr-only-focusable | @include sr-only-focusable(); |
Usage
Use .sr-only
to hide an element on all devices except for screen readers.
Use .sr-only
with .sr-only-focusable
to show the element again when it’s focused (e.g. by a keyboard-only user).
Variants
By default, no responsive or hover-state variants are generated for accessibility utilities.
Responsive
To include responsive variants like .md:sr-only
, add "accessibility"
to the $responsive-variants
variable in your theme’s _variables.scss
file when recompiling your CSS:
$responsive-variants: (
// ...
"accessibility",
);
Hover-state
To include hover-state variants like .hover:sr-only
, add "accessibility"
to the $hover-variants
variable:
$hover-variants: (
// ...
"accessibility",
);