Skip to content

Instantly share code, notes, and snippets.

@jtwalters
Created December 9, 2014 22:06
Show Gist options
  • Save jtwalters/2bb9e398c403e5bfe061 to your computer and use it in GitHub Desktop.
Save jtwalters/2bb9e398c403e5bfe061 to your computer and use it in GitHub Desktop.
// Cross-scope compatible placeholder boilerplate.
@mixin my-mixin($extend: true) {
@if $extend {
@extend %my-mixin;
}
@else {
// Mixin core
}
}
%my-mixin {
@include my-mixin($extend: false);
}
// Example usage.
.my-class {
@include my-mixin;
}
@media (min-width: 48em) {
.c {
@include my-mixin(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment