Skip to content

Instantly share code, notes, and snippets.

@siamak
Created April 9, 2016 22:52
Show Gist options
  • Save siamak/349dd986be160904df3645fef13105d0 to your computer and use it in GitHub Desktop.
Save siamak/349dd986be160904df3645fef13105d0 to your computer and use it in GitHub Desktop.
Sass (SCSS) Colors Maps. `map-get`
$colors: (
red: (
base : #FF4E4E,
dark : #FF0005
),
dark: (
base : #212121,
normal : #333333,
light : #E0E0E0
)
);
@function palette($palette, $tone: 'base', $default: $colors) {
@return map-get(map-get($default, $palette), $tone);
}
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