Skip to content

Commit

Permalink
fix: prevent leaking of -zf-size in -zf-each-breakpoint mixin
Browse files Browse the repository at this point in the history
Closes foundation#10818
Note: this also remove some useless logic in `@mixin breakpoint`
  • Loading branch information
ncoden committed Dec 23, 2017
1 parent a8ad968 commit 31f46c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 1 addition & 6 deletions scss/util/_breakpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion scss/util/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -277,6 +281,8 @@
@else {
@content;
}

$-zf-size: $old-zf-size !global;
}
}

Expand Down

0 comments on commit 31f46c2

Please sign in to comment.