0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-28 10:24:19 +01:00

modified the yiq to to an actual function

function only returns a value, not the attribute itself
updated every use of the former mixin to use the new function
This commit is contained in:
gijsbotje 2017-09-13 17:32:44 +02:00
parent cf004433e0
commit cc092272ee
4 changed files with 10 additions and 10 deletions

View File

@ -4,21 +4,21 @@
@each $color, $value in $colors {
.swatch-#{$color} {
color: color-yiq($value);
background-color: #{$value};
@include color-yiq($value);
}
}
@each $color, $value in $theme-colors {
.swatch-#{$color} {
color: color-yiq($value);
background-color: #{$value};
@include color-yiq($value);
}
}
@each $color, $value in $grays {
.swatch-#{$color} {
color: color-yiq($value);
background-color: #{$value};
@include color-yiq($value);
}
}

View File

@ -49,7 +49,7 @@
}
// Color contrast
@mixin color-yiq($color) {
@function color-yiq($color) {
$r: red($color);
$g: green($color);
$b: blue($color);
@ -57,9 +57,9 @@
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
@if ($yiq >= 150) {
color: #111;
@return #111;
} @else {
color: #fff;
@return #fff;
}
}

View File

@ -1,11 +1,11 @@
@mixin badge-variant($bg) {
@include color-yiq($bg);
color: color-yiq($bg);
background-color: $bg;
&[href] {
@include hover-focus {
@include color-yiq($bg);
text-decoration: none;
color: color-yiq($bg);
background-color: darken($bg, 10%);
}
}

View File

@ -4,13 +4,13 @@
// and disabled options for all buttons
@mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) {
@include color-yiq($background);
color: color-yiq($background);
background-color: $background;
border-color: $border;
@include box-shadow($btn-box-shadow);
@include hover {
@include color-yiq($active-background);
color: color-yiq($active-background);
background-color: $active-background;
border-color: $active-border;
}