Commit 8a98bfd8 authored by Mark Otto's avatar Mark Otto
Browse files

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

parents fac70149 98778164
6 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!25494web pack,!25326Adjust examples,!23207#22402 : modal: new autofocus & keyboardBtnNav options,!17021v4
Showing with 10 additions and 10 deletions
+10 -10
......@@ -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);
}
}
......@@ -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;
}
}
......
@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%);
}
......
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment