Created
April 26, 2015 17:24
-
-
Save lucadegasperi/a3950a306ae2044bb6d8 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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