0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-28 20:52:21 +01:00

Merge branch 'yiq-function-update' of https://github.com/gijsbotje/bootstrap into v4-dev

This commit is contained in:
Mark Otto 2017-10-17 17:29:15 -07:00
commit 8a98bfd8c9
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,10 +1,10 @@
@mixin badge-variant($bg) {
@include color-yiq($bg);
color: color-yiq($bg);
background-color: $bg;
&[href] {
@include hover-focus {
@include color-yiq($bg);
color: color-yiq($bg);
text-decoration: none;
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;
}