Skip to content

Commit 000e238

Browse files
committed
Adds variable for color yiq threshold
1 parent 80d4a51 commit 000e238

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scss/_functions.scss

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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)