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:
@@ -43,9 +43,15 @@
|
||||
// scss-docs-start alert-modifiers
|
||||
// Generate contextual modifier classes for colorizing the alert.
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
.alert-#{$color} {
|
||||
@include alert-variant(scale-color($value, $alert-bg-scale), scale-color($value, $alert-border-scale), scale-color($value, $alert-color-scale));
|
||||
@each $state, $value in $theme-colors {
|
||||
$background: scale-color($value, $alert-bg-scale);
|
||||
$border: scale-color($value, $alert-border-scale);
|
||||
$color: scale-color($value, $alert-color-scale);
|
||||
@if (contrast-ratio($background, $color) < $min-contrast-ratio) {
|
||||
$color: mix($value, color-contrast($background), abs($alert-color-scale));
|
||||
}
|
||||
.alert-#{$state} {
|
||||
@include alert-variant($background, $border, $color);
|
||||
}
|
||||
}
|
||||
// scss-docs-end alert-modifiers
|
||||
|
Reference in New Issue
Block a user