From 121ed244822a0331c23bc2179ccb58d8943234b0 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Tue, 6 Dec 2016 06:56:50 +0100 Subject: [PATCH] Fix -zf-each-breakpoint without small bp `$breakpoint-classes` is a list, not a map. Use `sl-remove()` from SassyList (https://github.com/at-import/SassyLists) instead of `map-remove()` to remove the small breakpoint from `$breakpoint-classes`. Other changes: - Rename `$map` to `$list`. - Rename `$size` to `$name`. `$breakpoint-classes` contains breakpoint names, not sizes. Keep `$-zf-size` for compatibility. --- gulp/config.js | 3 ++- gulp/tasks/customizer.js | 3 ++- package.json | 1 + scss/foundation.scss | 1 + scss/util/_mixins.scss | 10 +++++----- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gulp/config.js b/gulp/config.js index 74d2de5a0..32abf73b1 100644 --- a/gulp/config.js +++ b/gulp/config.js @@ -23,7 +23,8 @@ module.exports = { // Sass SASS_DEPS_FILES: [ - 'node_modules/@(normalize-scss)/sass/**/*.scss' + 'node_modules/@(normalize-scss)/sass/**/*.scss', + 'node_modules/@(sassy-lists)/stylesheets/**/*.scss' ], SASS_DOC_PATHS: [ diff --git a/gulp/tasks/customizer.js b/gulp/tasks/customizer.js index 3685222a0..408787e6c 100644 --- a/gulp/tasks/customizer.js +++ b/gulp/tasks/customizer.js @@ -49,7 +49,8 @@ gulp.task('customizer:loadConfig', function(done) { // Prepare dependencies gulp.task('customizer:prepareSassDeps', function() { return gulp.src([ - 'node_modules/@(normalize-scss)/sass/**/*.scss' + 'node_modules/@(normalize-scss)/sass/**/*.scss', + 'node_modules/@(sassy-lists)/stylesheets/**/*' ]) .pipe(gulp.dest('_vendor/scss')); }); diff --git a/package.json b/package.json index 5e79dc969..32fde7d03 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "rimraf": "^2.3.2", "run-sequence": "^1.1.4", "sass-true": "^2.0.3", + "sassy-lists": "^3.0.0", "sinon": "^1.17.3", "supercollider": "^1.4.0", "touch": "^1.0.0", diff --git a/scss/foundation.scss b/scss/foundation.scss index d0c58689c..d41471413 100644 --- a/scss/foundation.scss +++ b/scss/foundation.scss @@ -7,6 +7,7 @@ // Dependencies @import "../_vendor/scss/normalize-scss/sass/normalize"; +@import "../_vendor/scss/sassy-lists/stylesheets/SassyLists"; // Settings // import your own `settings` here or diff --git a/scss/util/_mixins.scss b/scss/util/_mixins.scss index 8959ebdf0..b32e2c95f 100644 --- a/scss/util/_mixins.scss +++ b/scss/util/_mixins.scss @@ -228,16 +228,16 @@ /// /// @param {Boolean} $small [true] - If `false`, the mixin will skip the `small` breakpoint. Use this with components that don't prefix classes with `small-`, only `medium-` and up. @mixin -zf-each-breakpoint($small: true) { - $map: $breakpoint-classes; + $list: $breakpoint-classes; @if not $small { - $map: map-remove($map, $-zf-zero-breakpoint); + $list: sl-remove($list, $-zf-zero-breakpoint); } - @each $size in $map { - $-zf-size: $size !global; + @each $name in $list { + $-zf-size: $name !global; - @include breakpoint($size) { + @include breakpoint($name) { @content; } } -- 2.47.2