Last active
August 29, 2015 14:12
-
-
Save zipme/2c0110d622df91c3e8c3 to your computer and use it in GitHub Desktop.
BEM Sass Mixins
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
/// Block Element | |
/// @access public | |
/// @param {String} $element - Element's name | |
@mixin element($element) { | |
&__#{$element} { | |
@content; | |
} | |
} | |
/// Block Modifier | |
/// @access public | |
/// @param {String} $modifier - Modifier's name | |
@mixin modifier($modifier) { | |
&--#{$modifier} { | |
@content; | |
} | |
} | |
/// @alias element | |
@mixin e($element) { | |
@include element($element) { | |
@content; | |
} | |
} | |
/// @alias modifier | |
@mixin m($modifier) { | |
@include modifier($modifier) { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment