Skip to content

Instantly share code, notes, and snippets.

@jonnymaceachern
Created November 1, 2016 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonnymaceachern/643ebe75aca596d01e57f7c406df94e8 to your computer and use it in GitHub Desktop.
Save jonnymaceachern/643ebe75aca596d01e57f7c406df94e8 to your computer and use it in GitHub Desktop.
// Mixin for alternate theme styling
@mixin theme( $blogname ){
body.theme-#{$blogname} & {
@content;
}
}
// Usage
.header {
color: #000;
background: #fff;
@include theme('autumn') {
color: #fff;
background: #000;
}
}
// Output
.header {
color: #000;
background: #fff;
}
body.theme-autumn .header {
color: #fff;
background: #000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment