Last active
September 22, 2016 19:10
-
-
Save treetop1500/6506fa7b74b2341539b1373d943cb9cc to your computer and use it in GitHub Desktop.
Looping sass and incrementing by 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
.box { | |
@for $i from 0 through 9 { | |
$c : $i + 1; | |
&:nth-child(#{$c}) { | |
order: (($i - $i % 3) / 3) + 1; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.box:nth-child(1) { order: 1; } | |
.box:nth-child(2) { order: 1; } | |
.box:nth-child(3) { order: 1; } | |
.box:nth-child(4) { order: 2; } | |
.box:nth-child(5) { order: 2; } | |
.box:nth-child(6) { order: 2; } | |
.box:nth-child(7) { order: 3; } | |
.box:nth-child(8) { order: 3; } | |
.box:nth-child(9) { order: 3; } | |
.box:nth-child(10) { order: 4; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment