Skip to content

Commit 202e9cf

Browse files
committed
possible solution for foundation#8257
taking first breakpoint and check if smallest and define it as zero-breakpoint
1 parent e5746c7 commit 202e9cf

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

scss/grid/_flex-grid.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
}
214214
}
215215

216-
@if $-zf-size != small {
216+
@if $-zf-size != $zero-breakpoint-name {
217217
// Sizing (expand)
218218
@include breakpoint($-zf-size) {
219219
.#{$-zf-size}-expand {

scss/util/_breakpoint.scss

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ $breakpoints: (
1818
xxlarge: 1440px,
1919
) !default;
2020

21-
@if not map-has-key($breakpoints, small) or not map-has-key($breakpoints, medium) {
22-
@error 'Your list of breakpoints (defined in $breakpoints) must include one named "small" and one named "medium".';
23-
}
24-
@else if map-get($breakpoints, small) != 0 {
25-
@error 'Your "small" breakpoint (defined in $breakpoints) must be set to "0".';
21+
$zero-breakpoint-name: small !default;
22+
23+
@if nth(map-values($breakpoints),1) != 0 {
24+
@error 'Your smallest breakpoint (defined in $breakpoints) must be set to "0".';
25+
} @else {
26+
$zero-breakpoint-name: nth(map-keys($breakpoints),1);
2627
}
2728

2829
/// All of the names in this list will be output as classes in your CSS, like `.small-12`, `.medium-6`, and so on. Each value in this list must also be in the `$breakpoints` map.
@@ -32,7 +33,7 @@ $breakpoint-classes: (small medium large) !default;
3233
/// Generates a media query string matching the input value. Refer to the documentation for the `breakpoint()` mixin to see what the possible inputs are.
3334
///
3435
/// @param {Keyword|Number} $val [small] - Breakpoint name, or px, rem, or em value to process.
35-
@function breakpoint($val: small) {
36+
@function breakpoint($val: $zero-breakpoint-name) {
3637
// Size or keyword
3738
$bp: nth($val, 1);
3839
// Value for max-width media queries

scss/util/_mixins.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
$map: $breakpoint-classes;
221221

222222
@if not $small {
223-
$map: map-remove($map, small);
223+
$map: map-remove($map, $zero-breakpoint-name);
224224
}
225225

226226
@each $size in $map {

0 commit comments

Comments
 (0)