Skip to content

Instantly share code, notes, and snippets.

@BuddyLReno
Last active August 29, 2015 14:05
Show Gist options
  • Save BuddyLReno/4ba52931ba2f463ae64a to your computer and use it in GitHub Desktop.
Save BuddyLReno/4ba52931ba2f463ae64a to your computer and use it in GitHub Desktop.
Theming with Sass
<article class="EventPass theme--ljl">
<a href="#">test</a>
<p>test</p>
</article>
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
//colors
$default-primary: #000;
$default-secondary: #c8c7c7;
$ljl-primary: #e3a536;
$ljl-secondary: #3abce0;
//elements
@mixin color-theme(
$copy: $default-primary,
$background: $default-secondary
) {
%theme-copy {
color: $copy;
}
%theme-background {
background-color: $background;
}
}
//themes
.EventPass.theme--ljl {
@include color-theme($copy: $ljl-primary, $background: $ljl-secondary);
}
a {
@extend %theme-copy;
}
p {
@extend %theme-background;
}
.EventPass.theme--ljl a {
color: #e3a536;
}
.EventPass.theme--ljl p {
background-color: #3abce0;
}
<article class="EventPass theme--ljl">
<a href="#">test</a>
<p>test</p>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment