Skip to content

Commit 472f890

Browse files
authored
Update badge.scss
1 parent df5e04a commit 472f890

File tree

1 file changed

+9
-5
lines changed
  • packages/components/src/components/badge

1 file changed

+9
-5
lines changed

packages/components/src/components/badge/badge.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,18 @@
5454
block-size: fit-content;
5555
inline-size: fit-content;
5656
font-weight: 700;
57-
min-inline-size: calc(1.4em - 2 * #{variables.$db-spacing-fixed-2xs});
58-
box-sizing: content-box;
57+
58+
// Added a min-inline-size especially for single character contents, to ensure that it won't get any narrower than a circle.
59+
&:not(:empty) {
60+
min-inline-size: calc(1.4em - 2 * #{variables.$db-spacing-fixed-2xs});
61+
box-sizing: content-box;
62+
}
5963

6064
&:has(.db-icon) {
6165
padding: variables.$db-spacing-fixed-3xs;
6266
}
6367

64-
> *,
68+
>*,
6569
.db-icon {
6670
@extend %db-overwrite-font-size-2xs;
6771
}
@@ -78,14 +82,14 @@
7882
padding: variables.$db-spacing-fixed-2xs;
7983
}
8084

81-
> *,
85+
>*,
8286
.db-icon {
8387
@extend %db-overwrite-font-size-sm;
8488
}
8589
}
8690

8791
&:empty,
88-
> span:empty {
92+
>span:empty {
8993
block-size: var(--badge-size);
9094
inline-size: var(--badge-size);
9195
padding: 0;

0 commit comments

Comments
 (0)