Skip to content

Commit af07c6d

Browse files
committed
Merge branch 'main' into v11-major
2 parents 62cca13 + a0e52a3 commit af07c6d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.changeset/popular-geckos-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': patch
3+
---
4+
5+
Added in chart to map `Text` variants to font tokens

polaris.shopify.com/content/components/typography/text.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ examples:
4242
Use to set text color.
4343
---
4444

45+
## Variant tokens
46+
47+
Each variant uses a predetermined combination of the [font tokens](/tokens/font) to set the font size and line height. Heading variants have a set font weight but can be overridden by using the `fontWeight` prop.
48+
49+
| Variant | Font size token | px value | rem value | Font line height token | Font weight token | Reponsive |
50+
| ------------ | ------------------- | -------- | --------- | ---------------------- | -------------------------- | --------- |
51+
| `heading4Xl` | `--p-font-size-700` | 40 | 2.5 | `--p-line-height-7` | `--p-font-weight-bold` | Yes |
52+
| `heading3Xl` | `--p-font-size-600` | 32 | 2 | `--p-line-height-6` | `--p-font-weight-semibold` | Yes |
53+
| `heading2Xl` | `--p-font-size-500` | 28 | 1.75 | `--p-line-height-5` | `--p-font-weight-semibold` | Yes |
54+
| `headingXl` | `--p-font-size-400` | 24 | 1.5 | `--p-line-height-4` | `--p-font-weight-semibold` | Yes |
55+
| `headingLg` | `--p-font-size-300` | 20 | 1.25 | `--p-line-height-3` | `--p-font-weight-semibold` | Yes |
56+
| `headingMd` | `--p-font-size-200` | 16 | 1 | `--p-line-height-3` | `--p-font-weight-semibold` | No |
57+
| `headingSm` | `--p-font-size-100` | 14 | 0.875 | `--p-line-height-2` | `--p-font-weight-semibold` | No |
58+
| `headingXs` | `--p-font-size-75` | 12 | 0.75 | `--p-line-height-1` | `--p-font-weight-semibold` | No |
59+
| `bodyLg` | `--p-font-size-200` | 16 | 1 | `--p-line-height-2` | `--p-font-weight-regular` | No |
60+
| `bodyMd` | `--p-font-size-100` | 14 | 0.875 | `--p-line-height-2` | `--p-font-weight-regular` | No |
61+
| `bodySm` | `--p-font-size-75` | 12 | 0.75 | `--p-line-height-1` | `--p-font-weight-regular` | No |
62+
63+
---
64+
4565
## Mapping from previous type components
4666

4767
These are suggested replacements for existing text style components, but ultimately the best replacement should be evaluated based on the context of the usage. The `Text` component also requires setting the semantically appropriate html element through the `as` prop.

0 commit comments

Comments
 (0)