]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
transition() mixin prevent redundant 'transition: none' and pass `null` (#30391)
authorShohei Yoshida <ysds.code@gmail.com>
Wed, 1 Apr 2020 06:42:33 +0000 (15:42 +0900)
committerGitHub <noreply@github.com>
Wed, 1 Apr 2020 06:42:33 +0000 (09:42 +0300)
* Prevent redundant 'none' for prefers-reduced-motion

* Output warning when use 'none' or 'null' with multiple arguments

* Fix for libsass(node-sass)

scss/mixins/_transition.scss

index 54983d736c59f6d135e14abcd4790211a8ced313..54553deb9c67c3e3c573d4fbc770dd47c9710029 100644 (file)
@@ -1,13 +1,23 @@
 // stylelint-disable property-blacklist
 @mixin transition($transition...) {
+  @if length($transition) == 0 {
+    $transition: $transition-base;
+  }
+
+  @if length($transition) > 1 {
+    @each $value in $transition {
+      @if $value == null or $value == none {
+        @warn "The keyword 'none' or 'null' must be used as a single argument.";
+      }
+    }
+  }
+
   @if $enable-transitions {
-    @if length($transition) == 0 {
-      transition: $transition-base;
-    } @else {
+    @if nth($transition, 1) != null {
       transition: $transition;
     }
 
-    @if $enable-prefers-reduced-motion-media-query {
+    @if $enable-prefers-reduced-motion-media-query and nth($transition, 1) != null and nth($transition, 1) != none {
       @media (prefers-reduced-motion: reduce) {
         transition: none;
       }