Created
January 12, 2016 18:42
-
-
Save Rplus/0e029eeb0686fe81f874 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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.3.2) | |
// ---- | |
@function nth-selector($str, $n) { | |
@for $i from 1 through $n { | |
@if (str_index($str, ' ')) { | |
@if $i == $n { | |
$str: str_slice($str, 0, str_index($str, ' ') - 1); | |
} @else { | |
$str: str_slice($str, str_index($str, ' ') + 1); | |
} | |
} | |
} | |
@return unquote($str); | |
} | |
.grand-parent { | |
.parent { | |
content: '' + nth-selector(#{&}, 1); | |
#{nth-selector(#{&}, 2)} .cc { | |
width: 20px; | |
} | |
@at-root #{nth-selector(#{&}, 2)} .cc { | |
width: 10px; | |
} | |
} | |
} |
This file contains 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
.grand-parent .parent { | |
content: ".grand-parent"; | |
} | |
.grand-parent .parent .parent .cc { | |
width: 20px; | |
} | |
.parent .cc { | |
width: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment