Skip to content

Commit

Permalink
Backport #30605
Browse files Browse the repository at this point in the history
grid: checks for `$grid-columns > 0`
  • Loading branch information
MartijnCuppens authored and XhmikosR committed Apr 28, 2020
1 parent 9d00970 commit a66d9a3
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions scss/mixins/_grid-framework.scss
Expand Up @@ -15,12 +15,15 @@
@each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints);

// Allow columns to stretch full width below their breakpoints
@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@extend %grid-column;
@if $columns > 0 {
// Allow columns to stretch full width below their breakpoints
@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@extend %grid-column;
}
}
}

.col#{$infix},
.col#{$infix}-auto {
@extend %grid-column;
Expand All @@ -47,9 +50,11 @@
@include make-col-auto();
}

@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@include make-col($i, $columns);
@if $columns > 0 {
@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@include make-col($i, $columns);
}
}
}

Expand All @@ -61,11 +66,13 @@
.order#{$infix}-#{$i} { order: $i; }
}

// `$columns - 1` because offsetting by the width of an entire row isn't possible
@for $i from 0 through ($columns - 1) {
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
.offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns);
@if $columns > 0 {
// `$columns - 1` because offsetting by the width of an entire row isn't possible
@for $i from 0 through ($columns - 1) {
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
.offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns);
}
}
}
}
Expand Down

0 comments on commit a66d9a3

Please sign in to comment.