Skip to content
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

fix(badge): restore default text transform #2731

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(badge): restore default text transform
  • Loading branch information
denkristoffer committed Apr 25, 2024
commit 514013ca799d1552678a986973fa4a310761b159
21 changes: 15 additions & 6 deletions packages/components/badge/src/Badge/Badge.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ const sizeToStyles = ({ size }: { size: BadgeSize }): CSSObject => {
};

export const getBadgeStyles = (
textTransform: CSSProperties['textTransform'] = 'capitalize',
textTransform:
| Extract<CSSProperties['textTransform'], 'none'>
| undefined = undefined,
) => ({
badge: ({ variant, size }: BadgeStylesProps) =>
css({
Expand All @@ -83,9 +85,16 @@ export const getBadgeStyles = (
width: '0.875rem',
height: '0.875rem',
}),
badgeText: css({
color: 'currentcolor',
lineHeight: 'inherit',
textTransform,
}),
badgeText: css([
{
color: 'currentcolor',
lineHeight: 'inherit',
},
textTransform !== 'none' && {
textTransform: 'lowercase',
'&::first-letter': {
textTransform: 'uppercase',
},
},
]),
});
Loading