Skip to content

Instantly share code, notes, and snippets.

@benebun
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benebun/251786493c46238e18cb to your computer and use it in GitHub Desktop.
Save benebun/251786493c46238e18cb to your computer and use it in GitHub Desktop.
Extend sass 3.3 colour maps with warning and fallback to red colour
// extended from http://erskinedesign.com/blog/friendlier-colour-names-sass-maps/
@function palette($palette, $tone: 'base') {
$color: map-get(map-get($palettes, $palette), $tone);
@if $color == null {
@warn "Colour undefined: Palette '#{$palette}' doesn't yet define the tone '#{$tone}'!";
@return #{red};
}
@return $color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment