]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove useless .col-*-offset-12 and .col-xs-offset-0 classes
authorChris Rebert <code@chrisrebert.com>
Tue, 8 Dec 2015 09:50:42 +0000 (01:50 -0800)
committerChris Rebert <code@chrisrebert.com>
Tue, 8 Dec 2015 09:50:42 +0000 (01:50 -0800)
Fixes #18036

[skip sauce]
[skip validator]

scss/mixins/_grid-framework.scss

index aa5f4924ae7c2b716498cf39e67e7a7b626a9d41..bfe379ef82d4af46e7d07b1338dca69ce5216480 100644 (file)
@@ -13,7 +13,9 @@
     padding-left: ($gutter / 2);
     padding-right: ($gutter / 2);
   }
+  $breakpoint-counter: 0;
   @each $breakpoint in map-keys($breakpoints) {
+    $breakpoint-counter: ($breakpoint-counter + 1);
     @for $i from 1 through $columns {
       .col-#{$breakpoint}-#{$i} {
         @extend %grid-column;
           @include make-col-span($i, $columns);
         }
       }
-      @each $modifier in (pull, push, offset) {
+      @each $modifier in (pull, push) {
         @for $i from 0 through $columns {
           .col-#{$breakpoint}-#{$modifier}-#{$i} {
             @include make-col-modifier($modifier, $i, $columns)
           }
         }
       }
+      // `$columns - 1` because offsetting by the width of an entire row isn't possible
+      @for $i from 0 through ($columns - 1) {
+        @if $breakpoint-counter != 1 or $i != 0 { // Avoid emitting useless .col-xs-offset-0
+          .col-#{$breakpoint}-offset-#{$i} {
+            @include make-col-modifier(offset, $i, $columns)
+          }
+        }
+      }
     }
   }
 }