From 1d6e3710dd447de1a200f29e8fa521f8a0908f70 Mon Sep 17 00:00:00 2001 From: Andres Galante Date: Sat, 2 Dec 2017 00:26:10 -0300 Subject: [PATCH] Adds variable for color yiq threshold (#24886) --- scss/_functions.scss | 2 +- scss/_variables.scss | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scss/_functions.scss b/scss/_functions.scss index 5580dfa9ad..1266d34bd9 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -56,7 +56,7 @@ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; - @if ($yiq >= 150) { + @if ($yiq >= $yiq-contrasted-threshold) { @return $yiq-text-dark; } @else { @return $yiq-text-light; diff --git a/scss/_variables.scss b/scss/_variables.scss index 788c55a492..be3dd69b5f 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -87,11 +87,13 @@ $theme-colors: map-merge(( // Set a specific jump point for requesting color jumps $theme-color-interval: 8% !default; +// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255. +$yiq-contrasted-threshold: 150 !default; + // Customize the light and dark text colors for use in our YIQ color contrast function. $yiq-text-dark: $gray-900 !default; $yiq-text-light: $white !default; - // Options // // Quickly modify global styling by enabling or disabling optional features.