diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2020-11-08 21:49:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-08 21:49:26 +0300 |
commit | 67847b0aab5316550f74980f91fb32e85d70d96f (patch) | |
tree | 87bad663c5461f1245b338804b9a8b2ccb8b9687 /scss/_list-group.scss | |
parent | 4ed742e4db4717fc7de68a542fe2d825cdddfeb7 (diff) |
Add checks to fix color contrast issues (#32085)
Diffstat (limited to 'scss/_list-group.scss')
-rw-r--r-- | scss/_list-group.scss | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scss/_list-group.scss b/scss/_list-group.scss index 84fbb1b0ee..2ce0c8b159 100644 --- a/scss/_list-group.scss +++ b/scss/_list-group.scss @@ -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 |