Skip to content

Commit

Permalink
Adds variable for color yiq threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgalante committed Nov 27, 2017
1 parent 80d4a51 commit 000e238
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 000e238

Please sign in to comment.