mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-20 20:00:36 +03:00
Rename sr-only/sr-only-focusable (#31139)
* Rename `sr-only`/`sr-only-focusable` To be more representative of the fact that these are not necessarily "screen reader" specific, but actually apply to assistive technologies in general (and also things like Alexa/Siri/etc). Goes hand-in-hand with #31133 Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -5,21 +5,21 @@ description: Use screen reader utilities to hide elements on all devices except
|
||||
group: helpers
|
||||
---
|
||||
|
||||
Hide an element to all devices **except screen readers** with `.sr-only`. Use `.sr-only-focusable` to show the element only when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
|
||||
Hide an element to all devices **except screen readers** with `.visually-hidden`. Use `.visually-hidden-focusable` to show the element only when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
|
||||
|
||||
{{< example >}}
|
||||
<h2 class="sr-only">Title for screen readers</h2>
|
||||
<a class="sr-only-focusable" href="#content">Skip to main content</a>
|
||||
<h2 class="visually-hidden">Title for screen readers</h2>
|
||||
<a class="visually-hidden-focusable" href="#content">Skip to main content</a>
|
||||
{{< /example >}}
|
||||
|
||||
{{< highlight scss >}}
|
||||
// Usage as a mixin
|
||||
|
||||
.sr-only-title {
|
||||
@include sr-only;
|
||||
.visually-hidden-title {
|
||||
@include visually-hidden;
|
||||
}
|
||||
|
||||
.skip-navigation {
|
||||
@include sr-only-focusable;
|
||||
@include visually-hidden-focusable;
|
||||
}
|
||||
{{< /highlight >}}
|
||||
|
||||
Reference in New Issue
Block a user