Last active
August 29, 2015 14:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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