Skip to content

Instantly share code, notes, and snippets.

@lucadegasperi
Created April 26, 2015 17:24
Show Gist options
  • Save lucadegasperi/a3950a306ae2044bb6d8 to your computer and use it in GitHub Desktop.
Save lucadegasperi/a3950a306ae2044bb6d8 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// per ogni tema dichiaro la palette
$themes: (
theme1: (
base-color: red
),
theme2: (
base-color: blue
)
);
@mixin skin($property, $color) {
@each $key, $value in $themes {
@if map-get($value, $color) != null {
.t-#{$key} & {
#{$property}: map-get($value, $color);
}
} @else {
@warn('color is missing from theme');
}
}
}
// applico i colori del tema all elemento
a {
@include skin(color, base-color);
}
.t-theme1 a {
color: red;
}
.t-theme2 a {
color: blue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment