Created
April 26, 2015 17:33
-
-
Save lucadegasperi/cb9e756d80fb855b86b8 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($props) { | |
@each $key, $value in $themes { | |
.t-#{$key} & { | |
@each $property, $color in $props { | |
@if map-get($value, $color) != null { | |
#{$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, background: 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; | |
background: red; | |
} | |
.t-theme2 a { | |
color: blue; | |
background: blue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment