Skip to content

Instantly share code, notes, and snippets.

@impressivewebs
Created March 4, 2014 08:06
Show Gist options
  • Save impressivewebs/9342163 to your computer and use it in GitHub Desktop.
Save impressivewebs/9342163 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.5)
// Compass (v1.0.0.alpha.18)
// ----
@mixin theme($name, $color) {
$primary: $color;
$secondary: lightness(adjust-hue($color, 20));
.#{$name} {
.element {
color: $primary;
}
.other-element {
background: $secondary;
}
}
}
$themes: (
theme-banana: yellow,
theme-blueberry: purple,
theme-cherry: red
) !default;
@each $theme, $color in $themes {
@include theme($theme, $color);
}
.theme-banana .element {
color: yellow;
}
.theme-banana .other-element {
background: 50%;
}
.theme-blueberry .element {
color: purple;
}
.theme-blueberry .other-element {
background: 25.09804%;
}
.theme-cherry .element {
color: red;
}
.theme-cherry .other-element {
background: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment