Skip to content

Commit 2e02117

Browse files
committed
fix: use fallback gutter for fallback breakpoint in XY cell foundation#11194
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 foundation#11194
1 parent eaabca4 commit 2e02117

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scss/xy-grid/_cell.scss

+8-1
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,25 @@
110110
$breakpoint: null,
111111
$vertical: false
112112
) {
113+
$bp-is-fallback: false;
114+
113115
@if($breakpoint == null) {
114116
// If `$bp-size` is available then use this, otherwise revert to the smallest bp.
115117
@if(variable-exists(-zf-size) and type-of($-zf-size) != 'number') and $-zf-size != null {
116118
$breakpoint: $-zf-size;
117119
}
118120
@else {
119121
$breakpoint: $-zf-zero-breakpoint;
122+
$bp-is-fallback: true;
120123
}
121124
}
122125

123-
// Get the gutter for the passed breakpoint/value.
126+
// Get the gutter for the given breakpoint/value.
124127
$gutter: -zf-get-bp-val($gutters, $breakpoint);
128+
// If the breakpoint is a fallback, use a fallback gutter as well
129+
@if ($bp-is-fallback == true and $gutter == null) {
130+
$gutter: 0;
131+
}
125132

126133
@if($gutter != null) {
127134
// Base flex properties

0 commit comments

Comments
 (0)