Skip to content

Instantly share code, notes, and snippets.

@ericwbailey
Created May 29, 2019 19:45
Show Gist options
  • Save ericwbailey/29a33f87757da8051b3a583126e3d7fd to your computer and use it in GitHub Desktop.
Save ericwbailey/29a33f87757da8051b3a583126e3d7fd to your computer and use it in GitHub Desktop.
#writing #thoughtbot
@function c(
$name,
$theme:null,
$component:null,
) {
// Retrieve a palette color value
@if ($theme == null) and ($component == null) {
@return map-get($colors, $name);
}
// Retrieve a component color value
@else if ($theme != null) and ($component == null) {
@return map-get(map-get($colors, $name), $theme);
}
// Retrieve a themed component color value
@else {
@return map-get(map-get(map-get($colors, $name), $theme), $component);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment