]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: prevent leaking of `-zf-size` in `-zf-each-breakpoint` mixin 10819/head
authorNicolas Coden <nicolas@ncoden.fr>
Sat, 23 Dec 2017 16:14:29 +0000 (17:14 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 23 Dec 2017 16:14:29 +0000 (17:14 +0100)
Closes https://github.com/zurb/foundation-sites/issues/10818
Note: this also remove some useless logic in `@mixin breakpoint`

scss/util/_breakpoint.scss
scss/util/_mixins.scss

index 8948c7baccc5bac417e0c6ff5cc7628028b21e86..59782acf07015fbe379bff2154717a5bd942c747 100644 (file)
@@ -172,12 +172,7 @@ $breakpoint-classes: (small medium large) !default;
     }
   }
 
-  @if $old-zf-size != null {
-    // Restore the old breakpoint size
-    $-zf-size: $old-zf-size !global;
-  } @else {
-    $-zf-size: null !global;
-  }
+  $-zf-size: $old-zf-size !global;
 }
 
 /// Convers the breakpoints map to a URL-encoded string, like this: `key1=value1&key2=value2`. The value is then dropped into the CSS for a special `<meta>` tag, which is read by the Foundation JavaScript. This is how we transfer values from Sass to JavaScript, so they can be defined in one place.
index d5dbfdb656b408994c59d3be7202d0add0d99599..f208fb4219539a7db80af75171d6db11790bf8e4 100644 (file)
@@ -7,7 +7,7 @@
 ////
 
 /// Creates an inner box-shadow for only one side
-/// 
+///
 /// @param {Keyword} $side - Side the shadow is supposed to appear. Can be `top`, `left`, `right` or `bottom`.
 /// @param {Number} $size - Width for the target side.
 /// @param {Color} $color - Color of the shadow.
   }
 
   @each $name in $list {
+    $old-zf-size: null;
+    @if global-variable-exists(-zf-size) {
+      $old-zf-size: $-zf-size;
+    }
     $-zf-size: $name !global;
 
     @if $auto-insert-breakpoints {
     @else {
       @content;
     }
+
+    $-zf-size: $old-zf-size !global;
   }
 }