mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-18 11:21:23 +02:00
feature/yiq function, add parameters, with default values. (#26917)
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Color contrast
|
// Color contrast
|
||||||
@function color-yiq($color) {
|
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
|
||||||
$r: red($color);
|
$r: red($color);
|
||||||
$g: green($color);
|
$g: green($color);
|
||||||
$b: blue($color);
|
$b: blue($color);
|
||||||
@@ -57,9 +57,9 @@
|
|||||||
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
|
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
|
||||||
|
|
||||||
@if ($yiq >= $yiq-contrasted-threshold) {
|
@if ($yiq >= $yiq-contrasted-threshold) {
|
||||||
@return $yiq-text-dark;
|
@return $dark;
|
||||||
} @else {
|
} @else {
|
||||||
@return $yiq-text-light;
|
@return $light;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user