You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: polaris.shopify.com/content/design/typography.md
+30-21Lines changed: 30 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,6 @@ keywords:
8
8
icon: TypeMajor
9
9
---
10
10
11
-
By tying typographic styles to specific functions in the interface, we create a clear visual pattern for merchants to follow while they interact with our product.
12
-
13
-
---
14
-
15
11

16
12
17
13
## Working with typography
@@ -78,41 +74,54 @@ Ambiguous spacing can cause confusion and make it hard to understand the content
78
74
79
75
## Font sizes
80
76
81
-
We use the typographic scale to communicate visual hierarchy in text.
77
+
All font sizes have a ratio of 1.2, known as the major third type scale. This means that each size is multiplied or divided by 1.2 from the previous size, starting with the base size, and rounded to a multiple of 4px.
78
+
79
+
| Token | px value | rem value |
80
+
| ----------------- | -------- | --------- |
81
+
|`p-font-size-700`| 40 | 2.5 |
82
+
|`p-font-size-600`| 32 | 2 |
83
+
|`p-font-size-500`| 28 | 1.75 |
84
+
|`p-font-size-400`| 24 | 1.5 |
85
+
|`p-font-size-300`| 20 | 1.25 |
86
+
|`p-font-size-200`| 16 | 1 |
87
+
|`p-font-size-100`| 14 | 0.875 |
88
+
|`p-font-size-75`| 12 | 0.75 |
82
89
83
90
---
84
91
85
-
## Display styles
92
+
## Type styles
86
93
87
-
### PageHeading
94
+
Polaris type styles are grouped into two categories: heading and body. Each has a default set of variants along with a set of options to allow for flexibility and a wide range of applications within the user interface. They use one scale, so they can be applied to any screen size.
88
95
89
-
PageHeading is reserved for the title of a screen.
96
+
### Body styles
90
97
91
-

98
+
Body styles are used within components and blocks of text.
92
99
93
-
### Display
100
+

94
101
95
-
Display is for titling various interface elements, such as empty states and modals.
102
+
### Heading styles
96
103
97
-

104
+
Heading styles are used to create various levels of hierarchy on the page. These styles range in size and weight. Using a blend of the two can help distinguish content and guide merchants through the page.
98
105
99
-
### Heading
106
+
`headingXl` - `heading4xl` styles are typically used for numerals and key moments in the merchant’s journey. As the largest text on the screen, use these styles sparingly within a single page. These styles should draw the merchant’s attention to important key pieces of information.
100
107
101
-
Heading should always be used for titles of top-level sections of a screen. If the sections of a screen are represented by cards, each card’s title should use the Heading style.
108
+

102
109
103
-

110
+
`headingXs` - `headingLg` styles are most commonly used for card, section, or page titles.
104
111
105
-
### Subheading
112
+

106
113
107
-
If a top-level section of a screen has subsections, use the Subheading style for titling those subsections. Subheading should never appear as the first element in a card. Only use with titles (vs. sections of content).
114
+
### Responsive styles
108
115
109
-

116
+
Large heading styles, `headingLg` - `heading4xl`, are responsive and will change size at different breakpoints.
110
117
111
-
### Caption
118
+
Small heading styles, `headingXs` - `headingMd`, and body styles will remain the same size regardless of breakpoint unless specified. You can choose to adjust the size of these styles at specific breakpoints when needed. For instance, you may need to increase the size of important body text on smaller screens.
112
119
113
-
Caption is for providing details in places where content is compact and space is tight, like when it comes to data visualization.
0 commit comments