mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-29 16:19:53 +02:00
update badges to use the theme colors sass map
This commit is contained in:
@@ -27,16 +27,6 @@
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
// scss-lint:disable QualifyingElement
|
||||
// Add hover effects, but only for links
|
||||
a.badge {
|
||||
@include hover-focus {
|
||||
color: $badge-link-hover-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
// scss-lint:enable QualifyingElement
|
||||
|
||||
// Pill badges
|
||||
//
|
||||
// Make them extra rounded with a modifier to replace v3's badges.
|
||||
@@ -51,26 +41,8 @@ a.badge {
|
||||
//
|
||||
// Contextual variations (linked badges get darker on :hover).
|
||||
|
||||
.badge-default {
|
||||
@include badge-variant($badge-default-bg);
|
||||
}
|
||||
|
||||
.badge-primary {
|
||||
@include badge-variant($badge-primary-bg);
|
||||
}
|
||||
|
||||
.badge-success {
|
||||
@include badge-variant($badge-success-bg);
|
||||
}
|
||||
|
||||
.badge-info {
|
||||
@include badge-variant($badge-info-bg);
|
||||
}
|
||||
|
||||
.badge-warning {
|
||||
@include badge-variant($badge-warning-bg);
|
||||
}
|
||||
|
||||
.badge-danger {
|
||||
@include badge-variant($badge-danger-bg);
|
||||
@each $color, $value in $theme-colors {
|
||||
.badge-#{$color} {
|
||||
@include badge-variant($value);
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,12 @@
|
||||
// Badges
|
||||
|
||||
@mixin badge-variant($color) {
|
||||
background-color: $color;
|
||||
@mixin badge-variant($bg) {
|
||||
@include color-yiq($bg);
|
||||
background-color: $bg;
|
||||
|
||||
&[href] {
|
||||
@include hover-focus {
|
||||
background-color: darken($color, 10%);
|
||||
@include color-yiq($bg);
|
||||
text-decoration: none;
|
||||
background-color: darken($bg, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user