From: Andres Galante Date: Sat, 2 Dec 2017 03:26:10 +0000 (-0300) Subject: Adds variable for color yiq threshold (#24886) X-Git-Tag: v4.0.0-beta.3~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6e3710dd447de1a200f29e8fa521f8a0908f70;p=thirdparty%2Fbootstrap.git Adds variable for color yiq threshold (#24886) --- 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.