Skip to content

Instantly share code, notes, and snippets.

@wingrunr21
Created October 1, 2014 19:18
Show Gist options
  • Save wingrunr21/fd039ded81af117adf49 to your computer and use it in GitHub Desktop.
Save wingrunr21/fd039ded81af117adf49 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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;
}
}
}
.Component {
height: 10rem;
}
.Component-header {
height: 20rem;
}
.Component--small {
height: 5rem;
}
.Component--small .Component-header {
height: 10rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment