Skip to content

Commit

Permalink
grid: checks for $grid-columns > 0 (twbs#30605)
Browse files Browse the repository at this point in the history
Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
  • Loading branch information
2 people authored and olsza committed Oct 3, 2020
1 parent d2c1737 commit 52d1010
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions scss/mixins/_grid.scss
Expand Up @@ -85,17 +85,19 @@
@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);
}
}
}

// `$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);
// `$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 52d1010

Please sign in to comment.