]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: do not generate invalid xy-cell when breakpoint is not found 10821/head
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 24 Dec 2017 13:31:49 +0000 (14:31 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 24 Dec 2017 13:31:49 +0000 (14:31 +0100)
scss/xy-grid/_cell.scss

index 79cb3d71325b47306c44e655ffb23a367dab24d1..c2c1c7bb290754e2e549a4ff2a98126fcb237090 100644 (file)
     }
   }
 
-  // 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`'
   }
 }