Created
September 18, 2018 10:12
-
-
Save zoxon/34716368ac23e46ad0360da4662c1dac to your computer and use it in GitHub Desktop.
BEM and SCSS (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
block { | |
$root: &; // save parent | |
&__element { | |
color: blue; | |
} | |
&_is_active { | |
#{$root}__element { | |
color: red; | |
} | |
} | |
} | |
// => | |
// .block__element { | |
// color: blue; | |
// } | |
// .block_is_active .block__element { | |
// color: red; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment