Skip to content

Commit 5d3ff5c

Browse files
committed
Fix badge styles
1 parent 3b0b76a commit 5d3ff5c

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

scss/_components.badge.scss

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/* ## Badge
22
---------------------------------*/
33
$badge-font-size: $text-meta-sm !default;
4-
$badge-padding: 8px !default;
54
$badge-empty-size: 8px !default;
65

76
.badge {
87
display: inline-block;
9-
padding: 0 $badge-padding;
8+
padding: .25em .5em;
109
font-size: $badge-font-size;
11-
line-height: $line-height-loose;
10+
line-height: 1;
1211
text-align: center;
1312
white-space: nowrap;
1413
border-radius: 1993px;
14+
border: 1px solid transparent;
1515
vertical-align: middle;
1616
text-overflow: ellipsis;
1717
overflow: hidden;
1818

19-
@include badge-variant($grey-light, $grey-mute);
19+
@include badge-variant($component-bg, $grey-thin, $grey-dark);
2020

2121
&:empty {
2222
min-width: auto;
@@ -27,9 +27,25 @@ $badge-empty-size: 8px !default;
2727
}
2828

2929
// theme
30+
.badge.badge--black {
31+
@include badge-variant($black);
32+
}
33+
34+
.badge.badge--dark {
35+
@include badge-variant($grey-dark);
36+
}
37+
38+
.badge.badge--light {
39+
@include badge-variant($grey-light);
40+
}
41+
42+
.badge.badge--white {
43+
@include badge-variant($white);
44+
}
45+
3046
@each $name, $color in $theme-colors {
3147
.badge.badge--#{$name} {
32-
@include badge-variant($color)
48+
@include badge-variant($color);
3349
}
3450
}
3551

scss/mixins/_badge.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
// -----------------------------------------------------------------------------
33
@mixin badge-variant(
44
$background,
5+
$border: $background,
56
$color: invert-color($background)
67
) {
78
color: $color;
9+
border-color: $border;
810
background-color: $background;
9-
11+
1012
&.badge--link {
1113
cursor: pointer;
1214
&:hover {
15+
border-color: shade-color($background, 1);
1316
background-color: shade-color($background, 1);
1417
}
1518
&:active {
19+
border-color: shade-color($background, 2);
1620
background-color: shade-color($background, 2);
1721
}
1822
}

0 commit comments

Comments
 (0)