Accessability
Removes an elements visuals but is still accessible for screen readers. When using --focus modifier, the element will become visible when focused, allowing keyboard users to interact with it.
Screen Reader
Using screen reader class is possible on all elements. When used on focusable elements, the element will become visible when focused, allowing keyboard users to interact with it.
Usage
/* Format */
.u-sr__only--{focus} {}
/* Examples & modifiers */
.u-sr__only--focusable {}
| Modifier | Values | Description |
|---|---|---|
|
focus
|
focusable | Removes an elements visuals but is still accessible for screen readers. When using --focus modifier, the element will become visible when focused, allowing keyboard users to interact with it. |
Examples
Simple Screen Reader Only Utility
Applying the accessibility utility class makes the element non-visible on the display but accessible for the screen reader.
Try me in a screen reader (.u-sr__only). Hidden element -> Here is the hidden content without the modifier.
Try me in a screen reader (.u-sr__only--focusable). Hidden element -> Here is the hidden content with the modifier.