Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (21 sloc) 665 Bytes
/* ------------------------------------ *\
Text Contrast
\* ------------------------------------ */
////
/// @group Tools: Typography
/// @author Salem Ghoweri
////
/// Determines the correct color (black or white) to return, given the color passed in
/// @param {color} $color - The color to check against
/// @return {color} Either 'black' or 'white'
/// @example scss - $primary-background-default not shown
/// .element:hover {
/// color: bolt-text-contrast($primary-background-default);
/// }
@function bolt-text-contrast($color) {
@if bolt-theme-tone($color) == "dark" {
@return bolt-color(white);
} @else {
@return bolt-color(black);
}
}
You can’t perform that action at this time.