fix: resolve <Badge /> incorrect sizes - #22539
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95e695cfb6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jaaydenh
left a comment
There was a problem hiding this comment.
Code Review
🤖 Generated with Coder Agents
Overall this is a good cleanup — removing the border variant, normalizing icon sizes, and bringing stories in line with Figma. A few things to address:
Issues
1. Unconditional hover on default creates a redundant compound variant
The default variant now bakes in hover:bg-surface-tertiary:
default: "... hover:bg-surface-tertiary",
But there is still a compoundVariant that applies the same class only when hover: true:
{ hover: true, variant: "default", class: "hover:bg-surface-tertiary" },This means every default badge now changes background on hover, regardless of the hover prop. If that is the design intent, the compound variant is dead code and should be removed. If the intent was to only add the hover effect when hover={true}, the class should stay only in the compound variant.
2. xs size border-0 vs variant border border-solid — fragile override
xs applies border-0, but every variant (including default) now applies border border-solid. In Tailwind v3, which class wins depends on their order in the generated stylesheet, not in the class attribute. This works today but is fragile. Consider either:
- Removing the explicit
border border-solidfrom variants (the base already hasborder), or - Using a compound variant for
xsto explicitly remove borders for each applicable variant.
3. Icon size downgrade for md
md changed from [&_svg]:size-icon-sm (1.125rem/18px) to [&_svg]:size-icon-xs (0.875rem/14px). This is a ~22% reduction. All three sizes now use the same icon size (icon-xs), which seems intentional per Figma. Just flagging in case md badges with icons (e.g. TagInput) look noticeably smaller — worth a quick visual check.
Nits
- Warning/Destructive
xsstory has icon after text, whilesm/mdhave icon before text. Intentional per-design, or a typo in the stories? - Missing
purpleandmagentastories — the PR says it tracks all variants from Figma but these two are not covered. font-normalonmdwill override thefontWeight: "500"baked into the customtext-xsfontSize definition intailwind.config.js. Just making sure that's the intent since the oldmdusedfont-medium(500).
jaaydenh
left a comment
There was a problem hiding this comment.
Did something change regarding the designs of badges and their borders? When I look in Figma, atleast for licenses and dynamic paramters I wasn't aware of any changes.
Good old, |
This pull-request makes a few changes to our
<Badge />component to bring it inline with Figma.bordervariant of the component, border variants should be on allsmandmd.defaultvariant (per-design).xsandsmplus resolved iconography.xsvariants.