Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Created April 21, 2013 08:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glueckpress/5428896 to your computer and use it in GitHub Desktop.
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.
/**
* 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