Skip to content

Commit 699b707

Browse files
Add migration to replace-typography-declarations (#7335)
1 parent ea26158 commit 699b707

File tree

9 files changed

+980
-1
lines changed

9 files changed

+980
-1
lines changed

.changeset/stupid-suns-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris-migrator': minor
3+
---
4+
5+
Add migration to `replace-typography-declarations`

polaris-migrator/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,28 @@ Replace legacy static mixins with their corresponding declarations and CSS custo
9999
npx @shopify/polaris-migrator replace-static-mixins-with-declarations <path>
100100
```
101101

102+
### `replace-typography-declarations`
103+
104+
Replace legacy Typography functions and hardcoded lengths with Polaris custom properties for `font-family`, `font-size`, `font-weight`, and `line-height` declarations.
105+
106+
```diff
107+
- font-family: font-family(monospace);
108+
+ font-family: var(--p-font-family-mono);
109+
110+
- font-size: font-size(input, base);
111+
+ font-size: var(--p-font-size-200);
112+
113+
- font-weight: 400;
114+
+ font-weight: var(--p-font-weight-regular);
115+
116+
- line-height: line-height(caption, base);
117+
+ font-family: var(--p-font-line-height-2);
118+
```
119+
120+
```sh
121+
npx @shopify/polaris-migrator replace-typography-declarations <path>
122+
```
123+
102124
## Creating a migration
103125

104126
### Setup

0 commit comments

Comments
 (0)