Skip to content

Commit

Permalink
Update breakpoint mixin to store the $-zf-size value, so we can gra…
Browse files Browse the repository at this point in the history
…b it when using the mixin.
  • Loading branch information
brettsmason committed May 28, 2017
1 parent 70da211 commit 2f84122
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scss/util/_breakpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ $breakpoint-classes: (small medium large) !default;
$bp: index($-zf-breakpoints-keys, $value);
$pbp: index($-zf-breakpoints-keys, $print-breakpoint);

// Make breakpoint size available as a variable
$old-zf-size: $-zf-zero-breakpoint;
$-zf-size: $value !global;

// If $str is still an empty string, no media query is needed
@if $str == '' {
@content;
Expand All @@ -163,6 +167,9 @@ $breakpoint-classes: (small medium large) !default;
}
}
}

// 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.
Expand Down

0 comments on commit 2f84122

Please sign in to comment.