Skip to content

Instantly share code, notes, and snippets.

@wingrunr21
Created October 1, 2014 18:58
Show Gist options
  • Save wingrunr21/50fcf320b62a3bf33e76 to your computer and use it in GitHub Desktop.
Save wingrunr21/50fcf320b62a3bf33e76 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 mod($name) {
@at-root &--#{$name} { @content; }
}
.Component {
height: 10rem;
@include mod(red) { color: red; }
@include mod(green) { color: green; }
@include desc(header) {
height: 20rem;
strong {
color:black;
}
}
// How do I make the header's strong red or green depending on the parent modifier
}
.Component {
height: 10rem;
}
.Component--red {
color: red;
}
.Component--green {
color: green;
}
.Component-header {
height: 20rem;
}
.Component-header strong {
color: black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment