]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Make progress animation respect `$enable-transitions` and `prefers-reduced-motion...
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Tue, 15 Jan 2019 00:51:11 +0000 (01:51 +0100)
committerPatrick H. Lauke <redux@splintered.co.uk>
Tue, 15 Jan 2019 00:51:11 +0000 (00:51 +0000)
Make progress animation respect `$enable-transitions` and `prefers-reduced-motion` media query

scss/_progress.scss

index 0ac3e0c93f24aae812a15a603e137492ab82bf18..6247abe3fc17ab4301657627d5a89afabc37b2f9 100644 (file)
@@ -1,6 +1,9 @@
-@keyframes progress-bar-stripes {
-  from { background-position: $progress-height 0; }
-  to { background-position: 0 0; }
+// Disable animation if transitions are disabled
+@if $enable-transitions {
+  @keyframes progress-bar-stripes {
+    from { background-position: $progress-height 0; }
+    to { background-position: 0 0; }
+  }
 }
 
 .progress {
   background-size: $progress-height $progress-height;
 }
 
-.progress-bar-animated {
-  animation: progress-bar-stripes $progress-bar-animation-timing;
+@if $enable-transitions {
+  .progress-bar-animated {
+    animation: progress-bar-stripes $progress-bar-animation-timing;
+
+    @media (prefers-reduced-motion: reduce) {
+      animation: none;
+    }
+  }
 }