Skip to content

Instantly share code, notes, and snippets.

@Lochlan
Created June 17, 2014 00:01
Show Gist options
  • Save Lochlan/a819677a152b04f05913 to your computer and use it in GitHub Desktop.
Save Lochlan/a819677a152b04f05913 to your computer and use it in GitHub Desktop.
Generated compound selectors in Sass 3.3
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
@mixin element-compound($selector) {
$elements: a, p, div;
@each $el in $elements {
@at-root #{$el + $selector} {
@extend #{$selector};
}
}
}
.foo {
@include element-compound(".foo");
content: 'hiya';
}
.foo, a.foo, p.foo, div.foo {
content: 'hiya';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment