Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/guides/bs5migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,52 @@ The `.rounded-sm` and `.rounded-lg` classes have been replaced with `.rounded-1`
```

</ValidExample>

### Screen reader utilities

"Screen reader" classes are now "visually hidden" classes.

- Renamed `.sr-only` and `.sr-only-focusable` to `.visually-hidden` and `.visually-hidden-focusable`.
- Renamed `sr-only()` and `sr-only-focusable()` mixins to `visually-hidden()` and `visually-hidden-focusable()`.

<InvalidExample title="Don't">

```html
<span class="sr-only sr-only-focusable">
Visually hidden text
</span>
```

</InvalidExample>

<ValidExample title="Do">

```html
<span class="visually-hidden visually-hidden-focusable">
Visually hidden text
</span>
```

</ValidExample>

<InvalidExample title="Don't">

```scss
.my-hidden-text {
@include sr-only();
@include sr-only-focusable();
}
```

</InvalidExample>

<ValidExample title="Do">

```scss
.my-hidden-text {
@include visually-hidden();
@include visually-hidden-focusable();
}
```

</ValidExample>
Loading