Skip to content

Commit 1d6e371

Browse files
andresgalantemdo
authored andcommitted
Adds variable for color yiq threshold (#24886)
1 parent 0230150 commit 1d6e371

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scss/_functions.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
5858

59-
@if ($yiq >= 150) {
59+
@if ($yiq >= $yiq-contrasted-threshold) {
6060
@return $yiq-text-dark;
6161
} @else {
6262
@return $yiq-text-light;

scss/_variables.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ $theme-colors: map-merge((
8787
// Set a specific jump point for requesting color jumps
8888
$theme-color-interval: 8% !default;
8989

90+
// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255.
91+
$yiq-contrasted-threshold: 150 !default;
92+
9093
// Customize the light and dark text colors for use in our YIQ color contrast function.
9194
$yiq-text-dark: $gray-900 !default;
9295
$yiq-text-light: $white !default;
9396

94-
9597
// Options
9698
//
9799
// Quickly modify global styling by enabling or disabling optional features.

0 commit comments

Comments
 (0)