Skip to content

Instantly share code, notes, and snippets.

@emalgholzad
Last active March 7, 2017 08:19
Show Gist options
  • Save emalgholzad/80f3fad8c5374599b7c651156e41f500 to your computer and use it in GitHub Desktop.
Save emalgholzad/80f3fad8c5374599b7c651156e41f500 to your computer and use it in GitHub Desktop.
// Scheme of colors
$colorscheme: (
gray: (
base: #ccc,
light: #f2f2f2,
dark: #666
),
brown: (
base: #ab906b,
light: #ecdac3,
dark: #5e421c
)
);
// Our function for shorter usage of map-get();
@function setcolor($scheme, $tone: base) {
@return map-get(map-get($colorscheme, $scheme), $tone);
}
// Sass
.element {
color: setcolor(brown);
}
.element--light {
color: setcolor(brown, light);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment