aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Zalog <[email protected]>2020-04-18 12:51:50 +0300
committerGitHub <[email protected]>2020-04-18 11:51:50 +0200
commit338ca8382187ecf9cd7c4c1f63c28f7853330c2d (patch)
tree3984072d10dce8c0227b4073425fb7dab875e9d0
parentb79e55fed4740bc679e97d22b62a383885d16642 (diff)
downloadbootstrap-338ca8382187ecf9cd7c4c1f63c28f7853330c2d.tar.xz
bootstrap-338ca8382187ecf9cd7c4c1f63c28f7853330c2d.zip
grid: checks for `$grid-columns > 0` (#30605)
Co-authored-by: Martijn Cuppens <[email protected]>
-rw-r--r--scss/mixins/_grid.scss20
1 files changed, 11 insertions, 9 deletions
diff --git a/scss/mixins/_grid.scss b/scss/mixins/_grid.scss
index 94bf98a02..840cd6e0b 100644
--- a/scss/mixins/_grid.scss
+++ b/scss/mixins/_grid.scss
@@ -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);
+ }
}
}
}