Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Replace @while loops with @for loops #60

Merged
merged 1 commit into from

4 participants

@jodal

This makes the code shorter and easier to read. In addition, it makes it
compile successfully with pyScss, which doesn't support @while loops.

@jodal jodal Replace @while loops with @for loops
This makes the code shorter and easier to read. In addition, it makes it
compile successfully with pyScss, which doesn't support @while loops.
c36f81c
@bjornars

This is way more readable, +1

@jlong
Owner

@m5o Do you have an opinion?

@m5o
Collaborator

No, looking good.

@jlong jlong merged commit 385c1f5 into from
@jlong
Owner

Merged.

@jodal jodal deleted the branch
@SomeHats SomeHats referenced this pull request from a commit
@m5o m5o build bootstrap v2.3.1 from SASS files
* [Replace @while loops with @for loops](#60)

* [missing gradient-vertical-three-colors mixing}(#65)
538eee2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. @jodal

    Replace @while loops with @for loops

    jodal authored
    This makes the code shorter and easier to read. In addition, it makes it
    compile successfully with pyScss, which doesn't support @while loops.
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 19 deletions.
  1. +14 −19 lib/_mixins.scss
View
33 lib/_mixins.scss
@@ -578,16 +578,14 @@
}
@mixin grid-core-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
- @while $gridColumns > 0 {
- .span#{$gridColumns} { @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth)}
- $gridColumns: $gridColumns - 1;
+ @for $i from 1 through $gridColumns {
+ .span#{$i} { @include grid-core-span($i, $gridColumnWidth, $gridGutterWidth)}
}
}
@mixin grid-core-offset-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
- @while $gridColumns > 0 {
- .offset#{$gridColumns} { @include grid-core-offset($gridColumns, $gridColumnWidth, $gridGutterWidth); }
- $gridColumns: $gridColumns - 1;
+ @for $i from 1 through $gridColumns {
+ .offset#{$i} { @include grid-core-offset($i, $gridColumnWidth, $gridGutterWidth); }
}
}
@@ -627,17 +625,15 @@
}
@mixin grid-fluid-span-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
- @while $gridColumns > 0 {
- .span#{$gridColumns} { @include grid-fluid-span($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
- $gridColumns: $gridColumns - 1;
+ @for $i from 1 through $gridColumns {
+ .span#{$i} { @include grid-fluid-span($i, $fluidGridColumnWidth, $fluidGridGutterWidth); }
}
}
@mixin grid-fluid-offset-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
- @while $gridColumns > 0 {
- .offset#{$gridColumns} { @include grid-fluid-offset($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
- .offset#{$gridColumns}:first-child { @include grid-fluid-offset-first-child($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
- $gridColumns: $gridColumns - 1;
+ @for $i from 1 through $gridColums {
+ .offset#{$i} { @include grid-fluid-offset($i, $fluidGridColumnWidth, $fluidGridGutterWidth); }
+ .offset#{$i}:first-child { @include grid-fluid-offset-first-child($i, $fluidGridColumnWidth, $fluidGridGutterWidth); }
}
}
@@ -675,13 +671,12 @@
}
@mixin grid-input-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
- @while $gridColumns > 0 {
- input.span#{$gridColumns},
- textarea.span#{$gridColumns},
- .uneditable-input.span#{$gridColumns} {
- @include grid-input-span($gridColumns, $gridColumnWidth, $gridGutterWidth);
+ @for $i from 1 through $gridColumns {
+ input.span#{$i},
+ textarea.span#{$i},
+ .uneditable-input.span#{$i} {
+ @include grid-input-span($i, $gridColumnWidth, $gridGutterWidth);
}
- $gridColumns: $gridColumns - 1;
}
}
Something went wrong with that request. Please try again.