From 8e17aad5f1df2791177d31f7866d8528b9d4014f Mon Sep 17 00:00:00 2001 From: Andres Galante Date: Mon, 27 Nov 2017 08:27:35 -0300 Subject: [PATCH] Adds variable for color yiq threshold --- 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 5580dfa9adab..1266d34bd902 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 788c55a49213..be3dd69b5f39 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.