Skip to content

Commit

Permalink
Update micro plain/monochrome Button text to small
Browse files Browse the repository at this point in the history
This fix improves text size alignment on the FilterBar component. The "Clear all" button is now the same size as the other buttons in the FilterBar.
  • Loading branch information
sam-b-rose committed Mar 26, 2024
1 parent ddb9bf5 commit 1a05dc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-shoes-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Updated plain/monochrome Button text size to bodySm for micro
7 changes: 6 additions & 1 deletion polaris-react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,15 @@ export function Button({
textFontWeight = mdUp ? 'medium' : 'semibold';
}

let textVariant: TextProps['variant'] = 'bodySm';
if (size === 'large' || (hasPlainText && size !== 'micro')) {
textVariant = 'bodyMd';
}

const childMarkup = children ? (
<Text
as="span"
variant={size === 'large' || hasPlainText ? 'bodyMd' : 'bodySm'}
variant={textVariant}
fontWeight={textFontWeight}
// Fixes Safari bug that doesn't re-render button text to correct color
key={disabled ? 'text-disabled' : 'text'}
Expand Down

0 comments on commit 1a05dc9

Please sign in to comment.