Created
April 9, 2016 22:52
-
-
Save siamak/349dd986be160904df3645fef13105d0 to your computer and use it in GitHub Desktop.
Sass (SCSS) Colors Maps. `map-get`
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
$colors: ( | |
red: ( | |
base : #FF4E4E, | |
dark : #FF0005 | |
), | |
dark: ( | |
base : #212121, | |
normal : #333333, | |
light : #E0E0E0 | |
) | |
); |
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
@function palette($palette, $tone: 'base', $default: $colors) { | |
@return map-get(map-get($default, $palette), $tone); | |
} |
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
body { | |
background-color: palette(red, dark); | |
color: palette(dark); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment