// 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
// 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
$alert-bg-scale: -80% !default;
$alert-border-scale: -70% !default;
-$alert-color-scale: 50% !default;
+$alert-color-scale: 40% !default;
$alert-dismissible-padding-r: $alert-padding-x * 3 !default; // 3x covers width of x plus default padding on either side
$list-group-item-padding-y: $spacer / 2 !default;
$list-group-item-padding-x: $spacer !default;
$list-group-item-bg-scale: -80% !default;
-$list-group-item-color-scale: 50% !default;
+$list-group-item-color-scale: 40% !default;
$list-group-hover-bg: $gray-100 !default;
$list-group-active-color: $component-active-color !default;