]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Making use of `prefers-reduced-motion` media query (#25641)
authorMike Rogers <me@mikerogers.io>
Tue, 20 Mar 2018 09:28:21 +0000 (09:28 +0000)
committerPatrick H. Lauke <redux@splintered.co.uk>
Tue, 20 Mar 2018 09:28:21 +0000 (09:28 +0000)
* Making use of `prefers-reduced-motion` media query

As discussed in #25249 - if a user (Who is using Safari / iOS) requests
reduced motion in their system settings, we should avoid transitions.

* Ignoring prefers reduced motion for CSS Linting
* Updating copy clarifying the reduce motion functionality in accessibility.md

.stylelintrc
docs/4.0/getting-started/accessibility.md
scss/mixins/_transition.scss

index c9d67250e8914e87aecf7610b5edfe44981a9b9e..c65940be24473e3707675052b94203eb918f4f47 100644 (file)
@@ -33,6 +33,9 @@
     "no-descending-specificity": null,
     "no-duplicate-selectors": true,
     "number-leading-zero": "never",
+    "media-feature-name-no-unknown": [true, {
+      "ignoreMediaFeatureNames": ["prefers-reduced-motion"]
+    }],
     "order/properties-order": [
       "position",
       "top",
index 0f9e87ae184ac406eb046cd01232e08fa2a2059b..d4381aa21e5e5ce073d237477b60c30fa77f6721 100644 (file)
@@ -43,6 +43,10 @@ For visually hidden interactive controls, such as traditional "skip" links, `.sr
 <a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
 {% endhighlight %}
 
+### 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) will be disabled. Currently, support is limited to Safari on macOS and iOS.
+
 ## Additional resources
 
 - [Web Content Accessibility Guidelines (WCAG) 2.0](https://www.w3.org/TR/WCAG20/)
index 7e33dee3194ce7a7a192cea276dc99a13ea114cb..f853821344c96488b541496dbca01b3a4b763379 100644 (file)
@@ -6,4 +6,8 @@
       transition: $transition;
     }
   }
+
+  @media screen and (prefers-reduced-motion: reduce) {
+    transition: none;
+  }
 }