Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (28 sloc) 1.14 KB
////
/// @group Tools: Colors
////
/* ------------------------------------ *\
Color Palette
\* ------------------------------------ */
/// Helper functions for applying global color swatches stored in Sass Maps
/// @param {string} $color - Bolt color base (e.g. indigo)
/// @param {string} $tone [$bolt-color-default] - Bolt color tone (e.g. light)
/// @return {HSL|RGB} The mapped bolt color value
@function bolt-color($color, $tone: $bolt-color-default) {
@return map-get-deep($bolt-colors, "#{$color}", $tone);
}
/// Mixin to return color value
/// @param {string} $color - Bolt color base (e.g. indigo)
/// @param {string} $tone [$bolt-color-default] - Bolt color tone (e.g. light)
/// @param {string} $important [null] - If 'important', then !important will be added onto the declaration string value
/// @example scss - bolt-color mixin
/// .element {
/// @include bolt-color(indigo, light, important);
/// }
@mixin bolt-color($color, $tone: $bolt-color-default, $important: null) {
@if $important == important {
$important: !important;
}
/* stylelint-disable-next-line */
color: map-get-deep($bolt-colors, $color, $tone) $important;
}
You can’t perform that action at this time.