From e0f8eaef549c58b7537522d6dea07c63d3665a1b Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Sun, 24 Dec 2017 14:31:49 +0100 Subject: [PATCH] fix: do not generate invalid xy-cell when breakpoint is not found --- scss/xy-grid/_cell.scss | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scss/xy-grid/_cell.scss b/scss/xy-grid/_cell.scss index 79cb3d713..c2c1c7bb2 100644 --- a/scss/xy-grid/_cell.scss +++ b/scss/xy-grid/_cell.scss @@ -120,21 +120,26 @@ } } - // Get our gutters from map if available, if not map just return the value. + // Get the gutter for the passed breakpoint/value. $gutter: -zf-get-bp-val($gutters, $breakpoint); - // Base flex properties - @include xy-cell-base($size); + @if($gutter != null) { + // Base flex properties + @include xy-cell-base($size); - @if($gutter-type == 'margin') { - @include -xy-cell-properties($size, $gutter, $vertical); + @if($gutter-type == 'margin') { + @include -xy-cell-properties($size, $gutter, $vertical); + } + @else { + @include -xy-cell-properties($size, 0, $vertical); + } + + @if $gutter-output { + @include xy-gutters($gutter, $gutter-type, $gutter-position); + } } @else { - @include -xy-cell-properties($size, 0, $vertical); - } - - @if $gutter-output { - @include xy-gutters($gutter, $gutter-type, $gutter-position); + @warn 'xy-cell: no gutters were found in `$gutters` for "$breakpoint: #{$breakpoint}", cell was not generated`' } } -- 2.47.2