]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
More correct fix
authorKevin Ball <kmball11@gmail.com>
Tue, 1 Aug 2017 17:19:38 +0000 (10:19 -0700)
committerKevin Ball <kmball11@gmail.com>
Tue, 1 Aug 2017 17:19:38 +0000 (10:19 -0700)
scss/util/_breakpoint.scss

index c8562ba588a7cd0a36cf51f25bf9a1c6cc4cafa1..ce529ffc3903040f4b1147841404f621b74b3777 100644 (file)
@@ -145,7 +145,9 @@ $breakpoint-classes: (small medium large) !default;
   $pbp: index($-zf-breakpoints-keys, $print-breakpoint);
 
   // Make breakpoint size available as a variable
-  $old-zf-size: $-zf-size;
+  @if global-variable-exists(-zf-size) {
+    $old-zf-size: $-zf-size;
+  }
   $-zf-size: nth($value, 1) !global; // get the first value to account for `only` and `down` keywords
 
   // If $str is still an empty string, no media query is needed
@@ -168,8 +170,10 @@ $breakpoint-classes: (small medium large) !default;
     }
   }
 
-  // Restore the old breakpoint size
-  $-zf-size: $old-zf-size !global;
+  @if variable-exists(old-zf-size) {
+    // Restore the old breakpoint size
+    $-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.