Last active
August 29, 2015 13:56
-
-
Save laurentperroteau/8825348 to your computer and use it in GitHub Desktop.
Use "root" for preprocessor
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
// SASS/SCSS, less or stylus | |
.children-class { | |
color: red; | |
.parent-class & { | |
color: green; | |
} | |
} | |
=> compile in CSS | |
.children-class { color: red } | |
.parent-class .children-class { color: green } | |
// Do not confuse with "at-root" of SASS/SCSS for BEM | |
.level-1 { | |
color: red; | |
@at-root #{&}__level-2 { | |
color: green; | |
} | |
} | |
=> compile in CSS | |
.level-1 { color: red } | |
.level-1__level-2 { color: green } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment