aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-12-23 20:33:37 -0700
committerChris Rebert <[email protected]>2015-12-23 20:33:37 -0700
commit1e8743ec8970cc724590b6350c82b5098ed8cc86 (patch)
treea8408cef3e3ba256b3f6135a99194ee3e61ffd13
parentb6fcabf8925b3173f4043e56eee6949bcfdf8ff1 (diff)
parentc5a3e897d6d92a0dce61825b17e6a10c5c87ec17 (diff)
downloadbootstrap-1e8743ec8970cc724590b6350c82b5098ed8cc86.tar.xz
bootstrap-1e8743ec8970cc724590b6350c82b5098ed8cc86.zip
Merge pull request #18473 from twbs/fix-18036
Remove useless .col-*-offset-12 and .col-xs-offset-0 classes
-rw-r--r--dist/css/bootstrap.css20
-rw-r--r--scss/mixins/_grid-framework.scss12
2 files changed, 11 insertions, 21 deletions
diff --git a/dist/css/bootstrap.css b/dist/css/bootstrap.css
index a563aec84..68b821d38 100644
--- a/dist/css/bootstrap.css
+++ b/dist/css/bootstrap.css
@@ -988,10 +988,6 @@ pre code {
left: 100%;
}
-.col-xs-offset-0 {
- margin-left: 0;
-}
-
.col-xs-offset-1 {
margin-left: 8.333333%;
}
@@ -1036,10 +1032,6 @@ pre code {
margin-left: 91.666667%;
}
-.col-xs-offset-12 {
- margin-left: 100%;
-}
-
@media (min-width: 544px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
@@ -1194,9 +1186,6 @@ pre code {
.col-sm-offset-11 {
margin-left: 91.666667%;
}
- .col-sm-offset-12 {
- margin-left: 100%;
- }
}
@media (min-width: 768px) {
@@ -1353,9 +1342,6 @@ pre code {
.col-md-offset-11 {
margin-left: 91.666667%;
}
- .col-md-offset-12 {
- margin-left: 100%;
- }
}
@media (min-width: 992px) {
@@ -1512,9 +1498,6 @@ pre code {
.col-lg-offset-11 {
margin-left: 91.666667%;
}
- .col-lg-offset-12 {
- margin-left: 100%;
- }
}
@media (min-width: 1200px) {
@@ -1671,9 +1654,6 @@ pre code {
.col-xl-offset-11 {
margin-left: 91.666667%;
}
- .col-xl-offset-12 {
- margin-left: 100%;
- }
}
.table {
diff --git a/scss/mixins/_grid-framework.scss b/scss/mixins/_grid-framework.scss
index aa5f4924a..bfe379ef8 100644
--- a/scss/mixins/_grid-framework.scss
+++ b/scss/mixins/_grid-framework.scss
@@ -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;
@@ -32,13 +34,21 @@
@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)
+ }
+ }
+ }
}
}
}