neutraltone / gulp-boilerplate

:rocket: A opinionated gulp boilerplate for individuals and teams
MIT License
19 stars 1 forks source link

Tweak color function #25

Open neutraltone opened 7 years ago

neutraltone commented 7 years ago

Add warnings to color function like this:

@function color($color-name, $tone: base) {
    @if not map-has-key($colors, $color-name) {
        @warn "Color name `#{$color-name}` not found.";
    }
    @if not map-has-key(map-get($colors, $color-name), $tone) {
        @warn "Tone `#{$tone}` not found.";
    }
    @return map-get(map-get($colors, $color-name), $tone);
}