]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Backport #31882
authorGaël Poupard <ffoodd@users.noreply.github.com>
Mon, 19 Oct 2020 08:42:19 +0000 (11:42 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 27 Oct 2020 10:11:01 +0000 (12:11 +0200)
* 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 <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
scss/_spinners.scss
site/docs/4.5/components/spinners.md
site/docs/4.5/getting-started/accessibility.md

index 146c820675b0c3bb750a9a0c36e10f5e775f2117..00bb01784f6a9af88fd7132bb652947c915af49d 100644 (file)
   width: $spinner-width-sm;
   height: $spinner-height-sm;
 }
+
+@if $enable-prefers-reduced-motion-media-query {
+  @media (prefers-reduced-motion: reduce) {
+    .spinner-border,
+    .spinner-grow {
+      animation-duration: 1.5s;
+    }
+  }
+}
index c16594572776ba39bc766dac2be438dc7a2ad539..fe1a91ce7cbb832328d8a15fa414b6a2a28084d2 100644 (file)
@@ -12,6 +12,8 @@ Bootstrap "spinners" can be used to show the loading state in your projects. The
 
 For accessibility purposes, each loader here includes `role="status"` and a nested `<span class="sr-only">Loading...</span>`.
 
+{% include callout-info-prefersreducedmotion.md %}
+
 ## Border spinner
 
 Use the border spinners for a lightweight loading indicator.
index 8f78112b7122a6e152dcd8b0ac8390978383abae..62675c96354401e3e1c5fa83ff02520e41e1d17c 100644 (file)
@@ -45,7 +45,7 @@ For visually hidden interactive controls, such as traditional "skip" links, `.sr
 
 ### Reduced motion
 
-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.
+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.
 
 ## Additional resources