mirror of
https://github.com/twbs/bootstrap-sass.git
synced 2022-11-09 12:27:02 -05:00
Revert back to generating the grid with a for loop.
Function recursion raises an exception in Sass 3.2 (not yet released). This commit reverts back to the old way of doing things. It's probably simpler to understand, actually.
This commit is contained in:
parent
2a9d9bf4fb
commit
cf14f13b44
1 changed files with 12 additions and 16 deletions
28
vendor/assets/stylesheets/bootstrap/_mixins.scss
vendored
28
vendor/assets/stylesheets/bootstrap/_mixins.scss
vendored
|
@ -528,19 +528,17 @@
|
||||||
@include gridCoreSpanX($gridColumns, $columnWidth, $gutterWidth);
|
@include gridCoreSpanX($gridColumns, $columnWidth, $gutterWidth);
|
||||||
@include gridCoreOffsetX($gridColumns, $columnWidth, $gutterWidth);
|
@include gridCoreOffsetX($gridColumns, $columnWidth, $gutterWidth);
|
||||||
}
|
}
|
||||||
@mixin gridCoreSpanX($index, $columnWidth, $gutterWidth) {
|
@mixin gridCoreSpanX($cols, $columnWidth, $gutterWidth) {
|
||||||
@if $index != 0 {
|
@for $i from 1 through $cols {
|
||||||
.span#{$index} { @include gridCoreSpan($index, $columnWidth, $gutterWidth) };
|
.span#{$i} { @include gridCoreSpan($i, $columnWidth, $gutterWidth) };
|
||||||
@include gridCoreSpanX($index - 1, $columnWidth, $gutterWidth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin gridCoreSpan($columns, $columnWidth, $gutterWidth) {
|
@mixin gridCoreSpan($columns, $columnWidth, $gutterWidth) {
|
||||||
width: ($columnWidth * $columns) + ($gutterWidth * ($columns - 1));
|
width: ($columnWidth * $columns) + ($gutterWidth * ($columns - 1));
|
||||||
}
|
}
|
||||||
@mixin gridCoreOffsetX($index, $columnWidth, $gutterWidth) {
|
@mixin gridCoreOffsetX($cols, $columnWidth, $gutterWidth) {
|
||||||
@if $index != 0 {
|
@for $i from 1 through $cols {
|
||||||
.offset#{$index} { @include gridCoreOffset($index, $columnWidth, $gutterWidth); };
|
.offset#{$i} { @include gridCoreOffset($i, $columnWidth, $gutterWidth); };
|
||||||
@include gridCoreOffsetX($index - 1, $columnWidth, $gutterWidth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin gridCoreOffset($columns, $columnWidth, $gutterWidth) {
|
@mixin gridCoreOffset($columns, $columnWidth, $gutterWidth) {
|
||||||
|
@ -565,10 +563,9 @@
|
||||||
@include gridFluidSpanX($gridColumns, $columnWidth, $gutterWidth);
|
@include gridFluidSpanX($gridColumns, $columnWidth, $gutterWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin gridFluidSpanX($index, $columnWidth, $gutterWidth) {
|
@mixin gridFluidSpanX($cols, $columnWidth, $gutterWidth) {
|
||||||
@if $index != 0 {
|
@for $i from 1 through $cols {
|
||||||
.span#{$index} { @include gridFluidSpan($index, $columnWidth, $gutterWidth) };
|
.span#{$i} { @include gridFluidSpan($i, $columnWidth, $gutterWidth) };
|
||||||
@include gridFluidSpanX($index - 1, $columnWidth, $gutterWidth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin gridFluidSpan($columns, $columnWidth, $gutterWidth) {
|
@mixin gridFluidSpan($columns, $columnWidth, $gutterWidth) {
|
||||||
|
@ -584,10 +581,9 @@
|
||||||
// generate .spanX
|
// generate .spanX
|
||||||
@include gridInputSpanX($gridColumns, $columnWidth, $gutterWidth);
|
@include gridInputSpanX($gridColumns, $columnWidth, $gutterWidth);
|
||||||
}
|
}
|
||||||
@mixin gridInputSpanX($index, $columnWidth, $gutterWidth) {
|
@mixin gridInputSpanX($cols, $columnWidth, $gutterWidth) {
|
||||||
@if $index != 0 {
|
@for $i from 1 through $cols {
|
||||||
input.span#{$index}, textarea.span#{$index}, .uneditable-input.span#{$index} { @include gridInputSpan($index, $columnWidth, $gutterWidth); }
|
input.span#{$i}, textarea.span#{$i}, .uneditable-input.span#{$i} { @include gridInputSpan($i, $columnWidth, $gutterWidth); }
|
||||||
@include gridInputSpanX($index - 1, $columnWidth, $gutterWidth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin gridInputSpan($columns, $columnWidth, $gutterWidth) {
|
@mixin gridInputSpan($columns, $columnWidth, $gutterWidth) {
|
||||||
|
|
Loading…
Reference in a new issue