Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ----
// Requires Sass 3.4+
// ----
$elementSeparator: '';
$modifierSeparator: '--';
@mixin b($block) {
.#{$block} {
@content;
}
}
@mixin e($element) {
@at-root {
#{&}#{$elementSeparator+$element} {
@content;
}
}
}
@mixin m($modifier) {
@at-root {
#{&}#{$modifierSeparator+$modifier} {
@content;
}
}
}
// example
@include b(header) {
@include e(logo) {
// some props
}
@include m(foo) {
@include e(logo) {
// some props
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment