Commit a66d9a3d authored by Martijn Cuppens's avatar Martijn Cuppens Committed by XhmikosR
Browse files

Backport #30605

grid: checks for `$grid-columns > 0`
parent 9d009701
Showing with 19 additions and 12 deletions
+19 -12
...@@ -15,12 +15,15 @@ ...@@ -15,12 +15,15 @@
@each $breakpoint in map-keys($breakpoints) { @each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints); $infix: breakpoint-infix($breakpoint, $breakpoints);
// Allow columns to stretch full width below their breakpoints @if $columns > 0 {
@for $i from 1 through $columns { // Allow columns to stretch full width below their breakpoints
.col#{$infix}-#{$i} { @for $i from 1 through $columns {
@extend %grid-column; .col#{$infix}-#{$i} {
@extend %grid-column;
}
} }
} }
.col#{$infix}, .col#{$infix},
.col#{$infix}-auto { .col#{$infix}-auto {
@extend %grid-column; @extend %grid-column;
...@@ -47,9 +50,11 @@ ...@@ -47,9 +50,11 @@
@include make-col-auto(); @include make-col-auto();
} }
@for $i from 1 through $columns { @if $columns > 0 {
.col#{$infix}-#{$i} { @for $i from 1 through $columns {
@include make-col($i, $columns); .col#{$infix}-#{$i} {
@include make-col($i, $columns);
}
} }
} }
...@@ -61,11 +66,13 @@ ...@@ -61,11 +66,13 @@
.order#{$infix}-#{$i} { order: $i; } .order#{$infix}-#{$i} { order: $i; }
} }
// `$columns - 1` because offsetting by the width of an entire row isn't possible @if $columns > 0 {
@for $i from 0 through ($columns - 1) { // `$columns - 1` because offsetting by the width of an entire row isn't possible
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0 @for $i from 0 through ($columns - 1) {
.offset#{$infix}-#{$i} { @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
@include make-col-offset($i, $columns); .offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns);
}
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment