-
Notifications
You must be signed in to change notification settings - Fork 647
Token: Fix sizing, padding, and selected state styling #7165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
3a68610
a896e20
44a836b
3ec59e9
3d8ef33
0ab2a2f
a86a49f
bba3edb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': patch | ||
| --- | ||
|
|
||
| Fixes multiple styling issues in the Token component. | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import {clsx} from 'clsx' | |
| export interface TokenProps extends TokenBaseProps { | ||
| /** | ||
| * A component that renders before the token text | ||
| * disabled when size is 'small' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that any tokens using leading visuals and have a size of "small" will no longer render the leading visual?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that’s correct! as requested in the issue: |
||
| */ | ||
| leadingVisual?: React.ElementType | ||
| } | ||
|
|
@@ -71,7 +72,7 @@ const Token = forwardRef((props, forwardedRef) => { | |
| ref={forwardedRef} | ||
| style={{borderWidth: `${tokenBorderWidthPx}px`, ...style}} | ||
| > | ||
| {LeadingVisual ? ( | ||
| {LeadingVisual && size !== 'small' ? ( | ||
| <LeadingVisualContainer size={size}> | ||
| <LeadingVisual /> | ||
| </LeadingVisualContainer> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on my last comment, maybe this is worth a
minor? But let me know what you think! 😁