1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-31 00:59:51 +02:00

Add checks to fix color contrast issues (#32085)

This commit is contained in:
Martijn Cuppens
2020-11-08 19:49:26 +01:00
committed by GitHub
parent 4ed742e4db
commit 67847b0aab
3 changed files with 19 additions and 7 deletions

View File

@@ -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