Skip to content

Instantly share code, notes, and snippets.

@BuddyLReno
Created April 22, 2015 19:11
Show Gist options
  • Save BuddyLReno/c390d7d14e4767ea8de3 to your computer and use it in GitHub Desktop.
Save BuddyLReno/c390d7d14e4767ea8de3 to your computer and use it in GitHub Desktop.
Sass Theme Engine Blog
.post__title,
.post__subtitle {
color: black;
}
.theme--forest .post__title {
color: forestgreen;
}
.theme--forest .post__subtitle {
color: green;
}
.theme--forest {
@include theme-generator(
$post__title: forestgreen,
$post__subtitle: green
);
}
.theme--ocean {
@include theme-generator(
$post__subtitle: navy
);
}
.theme--forest .post__title {
color: forestgreen;
}
.theme--forest .post__subtitle {
color: green;
}
.theme--ocean .post__subtitle {
color: navy;
}
.post__title,
.post__subtitle {
color: black;
}
.theme--forest {
.post__title {
color: forestgreen;
}
.post__subtitle {
color: green;
}
}
.theme--forest {
%theme--post__title {
color: forestgreen;
}
}
.theme--ocean {
%theme--post__title {
color: navy;
}
}
.post__title {
@extend %theme--post__title;
color: black;
}
.theme--forest .post__title {
color: forestgreen;
}
.theme--ocean .post__title {
color: navy;
}
.post__title {
color: black;
}
.theme--forest {
@include theme-generator(
forestgreen,
green
);
}
.post__title {
@extend %theme--post__title;
color: black;
}
.post__subtitle {
@extend %theme--post__subtitle;
color: black;
}
@mixin theme-generator(
$post__title,
$post__subtitle
) {
%theme--post__title {
color: $post__title;
}
%theme--post__subtitle {
color: $post__subtitle;
}
}
@mixin theme-generator(
$post__title: "",
$post__subtitle: ""
) {
@if $post__title != "" {
%theme--post__title {
color: $post__title;
}
}
@if $post__subtitle != "" {
%theme--post__subtitle {
color: $post__subtitle;
}
}
}
.post__title {
@extend %theme--post__title !optional;
color: black;
}
.post__subtitle {
@extend %theme--post__subtitle !optional;
color: black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment