Skip to content

Commit ae52236

Browse files
authored
chore(badge): add min-width to small badge (#4072)
1 parent f8a5583 commit ae52236

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/eleven-wombats-sniff.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@twilio-paste/badge": patch
3+
"@twilio-paste/core": patch
4+
---
5+
6+
[Badge] add a min-width of size-base-50 to small badges to ensure badges with only one character (e.g. "1") render as a circle rather than an oval.

packages/paste-core/components/badge/src/Badge.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export const Badge = React.forwardRef<HTMLElement, BadgeProps>(
2929
element={element}
3030
paddingX={size === "small" ? "space20" : "space30"}
3131
paddingY={size === "small" ? "space10" : "space20"}
32+
minWidth={size === "small" ? "sizeBase50" : "size0"}
33+
justifyContent="center"
3234
variant={variant}
3335
ref={ref}
3436
{...badgeStyles}

0 commit comments

Comments
 (0)