2015-08-18 01:33:34 +00:00
|
|
|
// Base class
|
2013-02-18 06:20:49 +00:00
|
|
|
//
|
2015-08-18 01:33:34 +00:00
|
|
|
// Requires one of the contextual, color modifier classes for `color` and
|
|
|
|
// `background-color`.
|
2015-04-18 18:38:47 +00:00
|
|
|
|
2016-10-27 01:33:58 +00:00
|
|
|
.badge {
|
2014-12-06 08:33:36 +00:00
|
|
|
display: inline-block;
|
2016-10-27 01:33:58 +00:00
|
|
|
padding: $badge-padding-y $badge-padding-x;
|
2019-02-07 22:32:05 +00:00
|
|
|
@include font-size($badge-font-size);
|
2016-10-27 01:33:58 +00:00
|
|
|
font-weight: $badge-font-weight;
|
2013-02-18 06:20:49 +00:00
|
|
|
line-height: 1;
|
|
|
|
text-align: center;
|
2013-04-24 11:54:17 +00:00
|
|
|
white-space: nowrap;
|
2013-07-30 15:23:25 +00:00
|
|
|
vertical-align: baseline;
|
2017-10-03 04:11:11 +00:00
|
|
|
@include border-radius($badge-border-radius);
|
2018-12-21 21:55:05 +00:00
|
|
|
@include transition($badge-transition);
|
2013-08-11 19:43:43 +00:00
|
|
|
|
2018-09-14 12:31:48 +00:00
|
|
|
@at-root a#{&} {
|
2018-08-29 17:48:41 +00:00
|
|
|
@include hover-focus {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-26 17:56:22 +00:00
|
|
|
// Empty badges collapse automatically
|
2013-08-11 19:43:43 +00:00
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2015-08-27 12:10:32 +00:00
|
|
|
}
|
2013-10-23 20:14:34 +00:00
|
|
|
|
2016-12-26 17:56:22 +00:00
|
|
|
// Quick fix for badges in buttons
|
2016-10-27 01:33:58 +00:00
|
|
|
.btn .badge {
|
2015-08-27 12:10:32 +00:00
|
|
|
position: relative;
|
|
|
|
top: -1px;
|
2013-04-19 19:31:55 +00:00
|
|
|
}
|
|
|
|
|
2016-12-26 17:56:22 +00:00
|
|
|
// Pill badges
|
2015-08-05 07:45:41 +00:00
|
|
|
//
|
|
|
|
// Make them extra rounded with a modifier to replace v3's badges.
|
|
|
|
|
2016-10-27 01:33:58 +00:00
|
|
|
.badge-pill {
|
|
|
|
padding-right: $badge-pill-padding-x;
|
|
|
|
padding-left: $badge-pill-padding-x;
|
|
|
|
@include border-radius($badge-pill-border-radius);
|
2015-08-05 07:45:41 +00:00
|
|
|
}
|
|
|
|
|
2013-04-22 13:34:23 +00:00
|
|
|
// Colors
|
2015-04-18 18:38:47 +00:00
|
|
|
//
|
2016-12-26 17:56:22 +00:00
|
|
|
// Contextual variations (linked badges get darker on :hover).
|
2013-08-05 22:30:28 +00:00
|
|
|
|
2017-06-26 01:15:32 +00:00
|
|
|
@each $color, $value in $theme-colors {
|
|
|
|
.badge-#{$color} {
|
|
|
|
@include badge-variant($value);
|
|
|
|
}
|
2013-07-02 00:32:07 +00:00
|
|
|
}
|