Skip to content

Instantly share code, notes, and snippets.

@5t3ph
Last active January 24, 2021 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5t3ph/ee98f25da7416104f08b03bcd357028a to your computer and use it in GitHub Desktop.
Save 5t3ph/ee98f25da7416104f08b03bcd357028a to your computer and use it in GitHub Desktop.
$color-primary: purple;
$color-secondary: blue;
$color-support: green;
$theme-colors: (
primary: $color-primary,
secondary: $color-secondary,
support: $color-support
);
@function theme-color($key) {
@return map-get($theme-colors, $key);
}
@debug theme-color(primary);
// output: Line 15 CSS: purple
h1 {
color: theme-color(primary);
}
<h1>Hello World</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment