// ---- // Sass (v3.4.4) // Compass (v1.0.1) // ---- @mixin desc($name) { @at-root &-#{$name} { @content; } } @mixin tdesc($name, $parent) { @at-root #{$name} #{$parent} { @content; } } @mixin mod($name) { @at-root &--#{$name} { @content; } } @function with-parent($name, $parent) { @return #{$parent}-#{$name}; } .Component { height: 10rem; $parent: &; // .Component-header @include desc(header) { height: 20rem; } // .Component--small @include mod(small) { height: 5rem; @include tdesc(&, with-parent(header, $parent)) { height: 10rem; } } }