Created
April 21, 2013 08:27
-
-
Save glueckpress/5428896 to your computer and use it in GitHub Desktop.
How to prepend i.e. a .js class to the first level of a nested selector in SASS.
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
/** | |
* Prepend a selector to the first level of nested selectors. | |
* Comments demonstrate compiled CSS. | |
*/ | |
.foo { | |
/* .foo */ | |
.bar { | |
/* .foo .bar */ | |
.js & { /* .js .foo .bar */ } | |
&.foobar { | |
.js & { /* .js .foo .bar.foobar */ } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment