Created
March 26, 2015 04:58
-
-
Save a-am/50c20add332a5530f2a2 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
.box-1 | |
.box-2 | |
.box-3 | |
.box-4 |
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
// ---- | |
// libsass (v3.1.0) | |
// ---- | |
@mixin quantity-query( $number, $comparison: 'equal' ) { | |
$nth: ''; | |
@if index( ('greater' 'more' '>'), $comparison ) { | |
$nth: 'n + #{$number}'; | |
} @else if index( ('less' 'fewer' '<'), $comparison ) { | |
$nth: '-n + #{$number}'; | |
} @else if index( ('equal' 'same' '='), $comparison ) { | |
$nth: $number; | |
} @else { | |
@warn "Sorry, that's an invalid $comparison value." | |
} | |
&:nth-last-child(#{$nth}):first-child { | |
&, | |
& ~ * { | |
@content; | |
} | |
} | |
} | |
@mixin qq-equal( $number ) { | |
@include quantity-query( $number, equal ) { | |
@content; | |
} | |
} | |
@mixin qq-greater( $number ) { | |
@include quantity-query( $number, greater ) { | |
@content; | |
} | |
} | |
@mixin qq-less( $number ) { | |
@include quantity-query( $number, less ) { | |
@content; | |
} | |
} | |
test { | |
@include quantity-query(6, greater) { | |
content: 'n + 6'; | |
} | |
@include quantity-query(6, more) { | |
content: 'n + 6'; | |
} | |
@include quantity-query(6, '>') { | |
content: 'n + 6'; | |
} | |
@include qq-greater(6) { | |
content: 'n + 6'; | |
} | |
@include quantity-query(6, less) { | |
content: '-n + 6'; | |
} | |
@include quantity-query(6, fewer) { | |
content: '-n + 6'; | |
} | |
@include quantity-query(6, '<') { | |
content: '-n + 6'; | |
} | |
@include qq-less(6) { | |
content: '-n + 6'; | |
} | |
@include quantity-query(6) { | |
content: '6'; | |
} | |
@include quantity-query(6, equal) { | |
content: '6'; | |
} | |
@include quantity-query(6, same) { | |
content: '6'; | |
} | |
@include quantity-query(6, '=') { | |
content: '6'; | |
} | |
@include qq-equal(6) { | |
content: '6'; | |
} | |
} |
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
test:nth-last-child(n+6):first-child, test:nth-last-child(n+6):first-child ~ * { | |
content: 'n + 6'; } | |
test:nth-last-child(n+6):first-child, test:nth-last-child(n+6):first-child ~ * { | |
content: 'n + 6'; } | |
test:nth-last-child(n+6):first-child, test:nth-last-child(n+6):first-child ~ * { | |
content: 'n + 6'; } | |
test:nth-last-child(n+6):first-child, test:nth-last-child(n+6):first-child ~ * { | |
content: 'n + 6'; } | |
test:nth-last-child(-n+6):first-child, test:nth-last-child(-n+6):first-child ~ * { | |
content: '-n + 6'; } | |
test:nth-last-child(-n+6):first-child, test:nth-last-child(-n+6):first-child ~ * { | |
content: '-n + 6'; } | |
test:nth-last-child(-n+6):first-child, test:nth-last-child(-n+6):first-child ~ * { | |
content: '-n + 6'; } | |
test:nth-last-child(-n+6):first-child, test:nth-last-child(-n+6):first-child ~ * { | |
content: '-n + 6'; } | |
test:nth-last-child(6):first-child, test:nth-last-child(6):first-child ~ * { | |
content: '6'; } | |
test:nth-last-child(6):first-child, test:nth-last-child(6):first-child ~ * { | |
content: '6'; } | |
test:nth-last-child(6):first-child, test:nth-last-child(6):first-child ~ * { | |
content: '6'; } | |
test:nth-last-child(6):first-child, test:nth-last-child(6):first-child ~ * { | |
content: '6'; } | |
test:nth-last-child(6):first-child, test:nth-last-child(6):first-child ~ * { | |
content: '6'; } |
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='box-1'></div> | |
<div class='box-2'></div> | |
<div class='box-3'></div> | |
<div class='box-4'></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment