Skip to content

Commit

Permalink
Reuse of the color-yiq function
Browse files Browse the repository at this point in the history
This change refers to the issue twbs#23114
  • Loading branch information
envolute authored Aug 1, 2017
1 parent 698a7b4 commit 2aa31e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
}

// Color contrast
@mixin color-yiq($color) {
@mixin color-yiq($color, $prop: 'color') {
$r: red($color);
$g: green($color);
$b: blue($color);

$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;

@if ($yiq >= 150) {
color: #111;
#{$prop}: #111;
} @else {
color: #fff;
#{$prop}: #fff;
}
}

Expand Down

0 comments on commit 2aa31e6

Please sign in to comment.