Skip to content

Instantly share code, notes, and snippets.

@johndwells
Last active August 29, 2015 14:27
Show Gist options
  • Save johndwells/84632959e618c38c5faa to your computer and use it in GitHub Desktop.
Save johndwells/84632959e618c38c5faa to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="widget">
<div class="widget__cog">Cog</div>
</div>
/// Demonstrate how using the `@content` directive in an empty mixin
/// can be a handy tool to group related styles.
///
/// Below example is very arbitrary, but demonstrates possibilities of
/// including a mixin without being inside a selector.
///
/// @author John D Wells
@mixin t-group() {
@content;
}
@include t-group() {
.widget {
background-color: blue;
}
.widget__cog {
padding: 20px;
color: white;
}
}
.widget {
background-color: blue;
}
.widget__cog {
padding: 20px;
color: white;
}
<div class="widget">
<div class="widget__cog">Cog</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment