Add checks to fix color contrast issues (#32085)
This commit is contained in:
parent
4ed742e4db
commit
67847b0aab
3 changed files with 19 additions and 7 deletions
|
|
@ -151,7 +151,13 @@
|
|||
// Add modifier classes to change text and background color on individual items.
|
||||
// Organizationally, this must come after the `:hover` states.
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
@include list-group-item-variant($color, scale-color($value, $list-group-item-bg-scale), scale-color($value, $list-group-item-color-scale));
|
||||
@each $state, $value in $theme-colors {
|
||||
$background: scale-color($value, $list-group-item-bg-scale);
|
||||
$color: scale-color($value, $list-group-item-color-scale);
|
||||
@if (contrast-ratio($background, $color) < $min-contrast-ratio) {
|
||||
$color: mix($value, color-contrast($background), abs($alert-color-scale));
|
||||
}
|
||||
|
||||
@include list-group-item-variant($state, $background, $color);
|
||||
}
|
||||
// scss-docs-end list-group-modifiers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue