Repository navigation
fix(Badge): replace hardcoded height with spacing token - #653
Merged
Merged
Conversation
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsBadge · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Contributor
Author
|
@ernestt is the letter spacing here necessary? I think this came from the badge internally. Probably wouldn't make sense to tokenize so if we want to keep it I might make it a component override in the default theme instead of having a non themeable value in the base component. |
Contributor
|
Unclear to me why it was applied in the first place. We can just remove it. |
height: '20px' → spacingVars['--spacing-5'] (20px via token) so themes that override the spacing scale affect the badge chip height. letterSpacing: '-0.24px' is left as-is — no letter-spacing token exists in the XDS token system yet. See PR description for discussion. Night Watch — Theme Auditor Co-authored-by: Navi <[email protected]>
cixzhang
force-pushed
the
navi/theme-audit/badge
branch
from
March 18, 2026 00:03
dc68f6f to
0707aec
Compare
Remove letterSpacing: '-0.24px' from Badge base styles per review feedback. The value was carried over from the internal version with no clear reason to keep it. Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Theme Audit — Badge
Replace hardcoded
height: '20px'withspacingVars['--spacing-5'](which resolves to 20px) so the badge height respects theme overrides.Changes
packages/core/src/Badge/XDSBadge.tsx:height: '20px'→height: spacingVars['--spacing-5']Needs Review
letterSpacing: '-0.24px'(line 46): This is also a hardcoded value, but no letter-spacing token currently exists in the token system. Adding one is a broader design decision — flagging for human input on whether this warrants a new token or should stay hardcoded.Related audit notes (no fix needed)
DefaultIconinXDSAvatar.tsxrenders an inline SVG for the default person icon rather than usingXDSIcon+ the registry. However, nopersonicon exists inXDSIconName. Adding it would be feature work (new registry entry + default icon). Flagging for future consideration.