Skip to content

Instantly share code, notes, and snippets.

@napotopia
Created January 8, 2014 13:58
Show Gist options
  • Save napotopia/8317122 to your computer and use it in GitHub Desktop.
Save napotopia/8317122 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
/**
* Generate a solid class (for use in markup) and a silent class (for use with
* `@extend`) in one go.
*/
@mixin class($name) {
.#{$name},
%#{$name} {
@content
}
}
@include class(foo) {
color: red;
&:hover {
color: black;
}
}
@include class(foo--bar) {
font-weight: bold;
}
.bar {
@extend %foo;
@extend %foo--bar;
}
/**
* Generate a solid class (for use in markup) and a silent class (for use with
* `@extend`) in one go.
*/
.foo,
.bar {
color: red;
}
.foo:hover,
.bar:hover {
color: black;
}
.foo--bar,
.bar {
font-weight: bold;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment