Skip to content

Commit 4b30fe6

Browse files
ffooddXhmikosRpatrickhlauke
committed
Backport #31882
* feature(spinners): slow down spinners when prefers-reduced-motion * docs(spinners): add reduced motion callout and mention slowing down in accessibility page * Update spinners.md * docs(accessibility): rewording Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]>
1 parent efabff3 commit 4b30fe6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

scss/_spinners.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,12 @@
5454
width: $spinner-width-sm;
5555
height: $spinner-height-sm;
5656
}
57+
58+
@if $enable-prefers-reduced-motion-media-query {
59+
@media (prefers-reduced-motion: reduce) {
60+
.spinner-border,
61+
.spinner-grow {
62+
animation-duration: 1.5s;
63+
}
64+
}
65+
}

site/docs/4.5/components/spinners.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Bootstrap "spinners" can be used to show the loading state in your projects. The
1212

1313
For accessibility purposes, each loader here includes `role="status"` and a nested `<span class="sr-only">Loading...</span>`.
1414

15+
{% include callout-info-prefersreducedmotion.md %}
16+
1517
## Border spinner
1618

1719
Use the border spinners for a lightweight loading indicator.

site/docs/4.5/getting-started/accessibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For visually hidden interactive controls, such as traditional "skip" links, `.sr
4545

4646
### Reduced motion
4747

48-
Bootstrap includes support for the [`prefers-reduced-motion` media feature](https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion). In browsers/environments that allow the user to specify their preference for reduced motion, most CSS transition effects in Bootstrap (for instance, when a modal dialog is opened or closed, or the sliding animation in carousels) will be disabled.
48+
Bootstrap includes support for the [`prefers-reduced-motion` media feature](https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion). In browsers/environments that allow the user to specify their preference for reduced motion, most CSS transition effects in Bootstrap (for instance, when a modal dialog is opened or closed, or the sliding animation in carousels) will be disabled, and meaningful animations (such as spinners) will be slowed down.
4949

5050
## Additional resources
5151

0 commit comments

Comments
 (0)