Created
September 11, 2017 14:35
-
-
Save jstaffans/23c80963bd8db9ca9cddc4055ce9335a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// https://css-tricks.com/bem-101/ | |
=e($elements...) | |
$selector: () | |
@each $element in $elements | |
$selector: append($selector, unquote("&__" + $element), comma) | |
#{$selector} | |
@content | |
=m($modifiers...) | |
$selector: () | |
@each $modifier in $modifiers | |
$selector: append($selector, unquote("&--" + $modifier), comma) | |
#{$selector} | |
@content | |
.block { | |
+e(child) { | |
background: teal; | |
+m(featured, important) { | |
background: crimson; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment