Skip to content

Commit eba5665

Browse files
laurkimjuzser
authored andcommitted
Fix TextStyle migration to use fontWeight="semibold" instead of fontWeight="bold" (Shopify#7744)
### WHY are these changes introduced? After running `react-replace-text-components` in our core product, we've noticed that the fontWeight mapping is incorrect and should be using `semibold` instead of `bold`. ### WHAT is this pull request doing? Updates the font weight mapping on the style guide and in the migration.
1 parent 923dec6 commit eba5665

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.changeset/tiny-ravens-sing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/polaris-migrator': patch
3+
'polaris.shopify.com': patch
4+
---
5+
6+
Fixed mapping for `TextStyle` `variation="strong"` to use `Text` `fontWeight="semibold"` instead of `fontWeight="bold"`

polaris-migrator/src/migrations/react-replace-text-components/steps/replace-text-style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type {MigrationOptions} from '../react-replace-text-components';
2222
import {POLARIS_MIGRATOR_COMMENT} from '../../../constants';
2323

2424
const variationMap = {
25-
strong: {fontWeight: 'bold'},
25+
strong: {fontWeight: 'semibold'},
2626
subdued: {color: 'subdued'},
2727
positive: {color: 'success'},
2828
negative: {color: 'critical'},

polaris-migrator/src/migrations/react-replace-text-components/tests/react-replace-text-components.output.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function App() {
4444
<Text variant="bodySm" as="p">
4545
Caption
4646
</Text>
47-
<Text variant="bodyMd" fontWeight="bold" as="span">
47+
<Text variant="bodyMd" fontWeight="semibold" as="span">
4848
Strong
4949
</Text>
5050
<Text variant="bodyMd" color="success" as="span">

polaris-migrator/src/migrations/react-replace-text-components/tests/with-relative.output.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function App() {
3434
<Text variant="bodySm" as="p">
3535
Caption
3636
</Text>
37-
<Text variant="bodyMd" fontWeight="bold" as="span">
37+
<Text variant="bodyMd" fontWeight="semibold" as="span">
3838
Strong
3939
</Text>
4040
<Text variant="bodyMd" color="success" as="span">

polaris.shopify.com/content/components/text-style.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ status:
3737

3838
```diff
3939
- <TextStyle variation="strong">No supplier listed</TextStyle>
40-
+ <Text variant="bodyMd" as="span" fontWeight="bold">No supplier listed</Text>
40+
+ <Text variant="bodyMd" as="span" fontWeight="semibold">No supplier listed</Text>
4141
```
4242

4343
### Positive

0 commit comments

Comments
 (0)