Created
June 12, 2014 20:51
-
-
Save DannyJoris/a65d27d7911e22af4eed to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
| <div class="container"> | |
| <div class="column">Column 1</div> | |
| <div class="column">Column 2</div> | |
| <div class="column">Column 3</div> | |
| <div class="column">Column 4</div> | |
| <div class="column">Column 5</div> | |
| <div class="column">Column 6</div> | |
| <div class="column">Column 7</div> | |
| <div class="column">Column 8</div> | |
| <div class="column">Column 9</div> | |
| <div class="column">Column 10</div> | |
| <div class="column">Column 11</div> | |
| <div class="column">Column 12</div> | |
| <div class="column">Column 13</div> | |
| <div class="column">Column 14</div> | |
| <div class="column">Column 15</div> | |
| <div class="column">Column 16</div> | |
| </div> |
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.3.8) | |
| // Compass (v1.0.0.alpha.19) | |
| // ---- | |
| // Generates a very poor-man's nth-child type of selector | |
| // using incremental selectors. It creates ugly CSS which | |
| // would be understood by IE8. I would recommend using | |
| // http://selectivizr.com/ , but just in case you don't want | |
| // that this can be handy. I was just fooling around with Sass, | |
| // really. | |
| @function fn-selector($pos) { | |
| $selector: ''; | |
| @for $p from 1 through $pos { | |
| @if $p == 1 { | |
| $selector: '&'; | |
| } | |
| @else { | |
| $selector: $selector + ' + &'; | |
| } | |
| } | |
| @return $selector; | |
| } | |
| // $position: nth of total | |
| // $repeat: how often this pattern needs repeating. | |
| @mixin ie-nth-child($position: '1 2', $repeat: 2) { | |
| $pos: nth($position, 1); | |
| $total: nth($position, 2); | |
| @for $r from 1 through $repeat { | |
| @if $r > 1 { | |
| $pos: $pos + $total; | |
| } | |
| $selector: fn-selector($pos); | |
| #{$selector} { | |
| @content; | |
| } | |
| } | |
| } | |
| .column { | |
| padding: 10px; | |
| margin-bottom: 1px; | |
| max-width: 200px; | |
| color: white; | |
| background: #efefef; | |
| @include ie-nth-child(1 4, 3) { | |
| background: lightblue; | |
| } | |
| @include ie-nth-child(2 4, 3) { | |
| background: lightgreen; | |
| } | |
| @include ie-nth-child(3 4, 3) { | |
| background: pink; | |
| } | |
| @include ie-nth-child(4 4, 3) { | |
| background: gold; | |
| } | |
| } | |
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
| .column { | |
| padding: 10px; | |
| margin-bottom: 1px; | |
| max-width: 200px; | |
| color: white; | |
| background: #efefef; | |
| } | |
| .column { | |
| background: lightblue; | |
| } | |
| .column + .column + .column + .column + .column { | |
| background: lightblue; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column + .column + .column { | |
| background: lightblue; | |
| } | |
| .column + .column { | |
| background: lightgreen; | |
| } | |
| .column + .column + .column + .column + .column + .column { | |
| background: lightgreen; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column + .column + .column + .column { | |
| background: lightgreen; | |
| } | |
| .column + .column + .column { | |
| background: pink; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column { | |
| background: pink; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column + .column + .column + .column + .column { | |
| background: pink; | |
| } | |
| .column + .column + .column + .column { | |
| background: gold; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column + .column { | |
| background: gold; | |
| } | |
| .column + .column + .column + .column + .column + .column + .column + .column + .column + .column + .column + .column { | |
| background: gold; | |
| } |
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
| <div class="container"> | |
| <div class="column">Column 1</div> | |
| <div class="column">Column 2</div> | |
| <div class="column">Column 3</div> | |
| <div class="column">Column 4</div> | |
| <div class="column">Column 5</div> | |
| <div class="column">Column 6</div> | |
| <div class="column">Column 7</div> | |
| <div class="column">Column 8</div> | |
| <div class="column">Column 9</div> | |
| <div class="column">Column 10</div> | |
| <div class="column">Column 11</div> | |
| <div class="column">Column 12</div> | |
| <div class="column">Column 13</div> | |
| <div class="column">Column 14</div> | |
| <div class="column">Column 15</div> | |
| <div class="column">Column 16</div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment