]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: use fallback gutter for fallback breakpoint in XY cell #11194 11300/head
authorNicolas Coden <nicolas@ncoden.fr>
Fri, 25 May 2018 21:17:25 +0000 (23:17 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Fri, 25 May 2018 21:19:06 +0000 (23:19 +0200)
When no breakpoint is passed to `xy-cell` and a fallback "zero" breakpoint is used, use a fallback gutter as well if it is not found. This way, an implicit behavior stay implicit and a warning is thrown only if a breakpoint was explicitely given.

Closes https://github.com/zurb/foundation-sites/issues/11194

scss/xy-grid/_cell.scss

index 03bc425f395b37b225d6f60282da62cb5c9e14a6..6e811e9e9bd8980f2f94c40ccb7ed02d3a1d4378 100644 (file)
   $breakpoint: null,
   $vertical: false
 ) {
+  $bp-is-fallback: false;
+
   @if($breakpoint == null) {
     // If `$bp-size` is available then use this, otherwise revert to the smallest bp.
     @if(variable-exists(-zf-size) and type-of($-zf-size) != 'number') and $-zf-size != null {
     }
     @else {
       $breakpoint: $-zf-zero-breakpoint;
+      $bp-is-fallback: true;
     }
   }
 
-  // Get the gutter for the passed breakpoint/value.
+  // Get the gutter for the given breakpoint/value.
   $gutter: -zf-get-bp-val($gutters, $breakpoint);
+  // If the breakpoint is a fallback, use a fallback gutter as well
+  @if ($bp-is-fallback == true and $gutter == null) {
+    $gutter: 0;
+  }
 
   @if($gutter != null) {
     // Base flex properties