1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 16:50:00 +02:00

update alert component to use theme sass map and add a ton of options in the process

This commit is contained in:
Mark Otto
2017-06-25 18:22:51 -07:00
parent fc053ed096
commit 2392047a0c
3 changed files with 16 additions and 40 deletions

View File

@@ -41,15 +41,8 @@
//
// Generate contextual modifier classes for colorizing the alert.
.alert-success {
@include alert-variant($alert-success-bg, $alert-success-border-color, $alert-success-text);
}
.alert-info {
@include alert-variant($alert-info-bg, $alert-info-border-color, $alert-info-text);
}
.alert-warning {
@include alert-variant($alert-warning-bg, $alert-warning-border-color, $alert-warning-text);
}
.alert-danger {
@include alert-variant($alert-danger-bg, $alert-danger-border-color, $alert-danger-text);
@each $color, $value in $theme-colors {
.alert-#{$color} {
@include alert-variant(theme-color-level($color, -10), theme-color-level($color, -9), theme-color-level($color, 6));
}
}

View File

@@ -1,14 +1,13 @@
// Alerts
@mixin alert-variant($background, $border, $body-color) {
color: $body-color;
@mixin alert-variant($background, $border, $color) {
color: $color;
background-color: $background;
border-color: $border;
hr {
border-top-color: darken($border, 5%);
}
.alert-link {
color: darken($body-color, 10%);
color: darken($color, 10%);
}
}