From: Nicolas Coden Date: Sat, 23 Dec 2017 16:14:29 +0000 (+0100) Subject: fix: prevent leaking of `-zf-size` in `-zf-each-breakpoint` mixin X-Git-Tag: v6.6.0~3^2~321^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10819%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: prevent leaking of `-zf-size` in `-zf-each-breakpoint` mixin Closes https://github.com/zurb/foundation-sites/issues/10818 Note: this also remove some useless logic in `@mixin breakpoint` --- diff --git a/scss/util/_breakpoint.scss b/scss/util/_breakpoint.scss index 8948c7bac..59782acf0 100644 --- a/scss/util/_breakpoint.scss +++ b/scss/util/_breakpoint.scss @@ -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 `` 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. diff --git a/scss/util/_mixins.scss b/scss/util/_mixins.scss index d5dbfdb65..f208fb421 100644 --- a/scss/util/_mixins.scss +++ b/scss/util/_mixins.scss @@ -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. @@ -267,6 +267,10 @@ } @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 { @@ -277,6 +281,8 @@ @else { @content; } + + $-zf-size: $old-zf-size !global; } }