Skip to content

Commit 3438651

Browse files
sarahilllaurkim
andauthored
[Typography foundations] [Migration] Add new type styles to typography docs (#7609)
Fixes #7552 Add new type styles guidance and info to typography docs ![Frame 57915](https://user-images.githubusercontent.com/8629173/199514406-4467a30a-8522-4f02-967b-cfb71ad51a4a.png) Co-authored-by: Lo Kim <lo.kim@shopify.com>
1 parent f006509 commit 3438651

File tree

7 files changed

+35
-21
lines changed

7 files changed

+35
-21
lines changed

.changeset/sour-fireants-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': minor
3+
---
4+
5+
Added new type style guidance and info to typography docs

polaris.shopify.com/content/design/typography.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ keywords:
88
icon: TypeMajor
99
---
1010

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-
1511
![An illustration of letters constructed from lego blocks](/images/foundations/design/typography/text-featured@2x.png)
1612

1713
## Working with typography
@@ -78,41 +74,54 @@ Ambiguous spacing can cause confusion and make it hard to understand the content
7874

7975
## Font sizes
8076

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 |
8289

8390
---
8491

85-
## Display styles
92+
## Type styles
8693

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.
8895

89-
PageHeading is reserved for the title of a screen.
96+
### Body styles
9097

91-
![An interface showing the title of a page before its contents](/images/foundations/design/typography/type-pageheading@2x.png)
98+
Body styles are used within components and blocks of text.
9299

93-
### Display
100+
![An image showing how body styles are applied](/images/foundations/design/typography/text-body-example-01@2x.png)
94101

95-
Display is for titling various interface elements, such as empty states and modals.
102+
### Heading styles
96103

97-
![An empty state and a modal with large display headings](/images/foundations/design/typography/type-display@2x.png)
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.
98105

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.
100107

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+
![An image showing how heading styles are applied](/images/foundations/design/typography/text-heading-example-01@2x.png)
102109

103-
![Two interface cards with headings](/images/foundations/design/typography/type-heading@2x.png)
110+
`headingXs` - `headingLg` styles are most commonly used for card, section, or page titles.
104111

105-
### Subheading
112+
![An image showing how large heading styles are applied](/images/foundations/design/typography/text-heading-example-02@2x.png)
106113

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
108115

109-
![An interface card titled with a large heading text size followed by a smaller subheading](/images/foundations/design/typography/type-subheading@2x.png)
116+
Large heading styles, `headingLg` - `heading4xl`, are responsive and will change size at different breakpoints.
110117

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.
112119

113-
Caption is for providing details in places where content is compact and space is tight, like when it comes to data visualization.
120+
<video width="100%" height="auto" controls autoplay muted loop>
121+
<source src="/images/foundations/design/typography/text-responsive.mp4" type="video/mp4">
122+
</video>
114123

115-
![A line chart with small, caption-sized labels](/images/foundations/design/typography/type-caption@2x.png)
124+
![An image showing how heading styles change based on breakpoint](/images/foundations/design/typography/type-responsive-styles@2x.png)
116125

117126
---
118127

74.8 KB
Loading
78.8 KB
Loading
78.7 KB
Loading
Binary file not shown.
71 KB
Loading

0 commit comments

Comments
 (0)