Skip to content

Instantly share code, notes, and snippets.

@dmitry
Created April 6, 2014 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitry/10006929 to your computer and use it in GitHub Desktop.
Save dmitry/10006929 to your computer and use it in GitHub Desktop.
BEM shortcuts for SASS >= 3.3.0
// elements get appended with "__" and the $name
@mixin e($name) {
@at-root #{&}__#{$name} {
@content;
}
}
// modifiers get appended with "--" and the $name
@mixin m($name) {
@at-root #{&}--#{$name} {
@content;
}
}
// shortcut for @extend %name
@mixin x($name) {
@extend %#{$name} !optional;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment