Skip to content

Instantly share code, notes, and snippets.

@Adrian1907
Forked from siamak/colors.scss
Created February 23, 2018 09:23
Show Gist options
  • Select an option

  • Save Adrian1907/a472ba8e5e8c28a345353d1448df8eb5 to your computer and use it in GitHub Desktop.

Select an option

Save Adrian1907/a472ba8e5e8c28a345353d1448df8eb5 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