]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
grid: checks for `$grid-columns > 0` (#30605)
authorCatalin Zalog <c@zalog.ro>
Sat, 18 Apr 2020 09:51:50 +0000 (12:51 +0300)
committerGitHub <noreply@github.com>
Sat, 18 Apr 2020 09:51:50 +0000 (11:51 +0200)
Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
scss/mixins/_grid.scss

index 94bf98a02252ec0d278238953c4b9209dcefd80c..840cd6e0b4dea513bd1273c49f6be110c2232aa9 100644 (file)
         @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);
+            }
           }
         }
       }