1
0
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:
Mark Otto
2017-06-25 18:15:32 -07:00
parent b4879ec40f
commit aa83c4f417
3 changed files with 28 additions and 67 deletions

View File

@@ -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);
}
}

View File

@@ -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%);
}
}
}