0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-28 10:24:19 +01:00
grid: checks for `$grid-columns > 0`
This commit is contained in:
Martijn Cuppens 2020-04-18 12:09:01 +02:00 committed by XhmikosR
parent 9d0097013a
commit a66d9a3d50

View File

@ -15,12 +15,15 @@
@each $breakpoint in map-keys($breakpoints) { @each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints); $infix: breakpoint-infix($breakpoint, $breakpoints);
// Allow columns to stretch full width below their breakpoints @if $columns > 0 {
@for $i from 1 through $columns { // Allow columns to stretch full width below their breakpoints
.col#{$infix}-#{$i} { @for $i from 1 through $columns {
@extend %grid-column; .col#{$infix}-#{$i} {
@extend %grid-column;
}
} }
} }
.col#{$infix}, .col#{$infix},
.col#{$infix}-auto { .col#{$infix}-auto {
@extend %grid-column; @extend %grid-column;
@ -47,9 +50,11 @@
@include make-col-auto(); @include make-col-auto();
} }
@for $i from 1 through $columns { @if $columns > 0 {
.col#{$infix}-#{$i} { @for $i from 1 through $columns {
@include make-col($i, $columns); .col#{$infix}-#{$i} {
@include make-col($i, $columns);
}
} }
} }
@ -61,11 +66,13 @@
.order#{$infix}-#{$i} { order: $i; } .order#{$infix}-#{$i} { order: $i; }
} }
// `$columns - 1` because offsetting by the width of an entire row isn't possible @if $columns > 0 {
@for $i from 0 through ($columns - 1) { // `$columns - 1` because offsetting by the width of an entire row isn't possible
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0 @for $i from 0 through ($columns - 1) {
.offset#{$infix}-#{$i} { @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
@include make-col-offset($i, $columns); .offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns);
}
} }
} }
} }