Skip to content

Commit 8296f43

Browse files
[polaris.shopify.com] Create typography-updates.md (#6697)
* Create typography-updates.md * updates type updates post * Update typography-updates.md * updating content * Version Packages (#6694) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * content updates * update content and images * Update typography-updates.md * fix typo * Update images * Update image missed bottom border * Update image paths * Create short-fans-deliver.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 822218c commit 8296f43

File tree

6 files changed

+169
-0
lines changed

6 files changed

+169
-0
lines changed

.changeset/short-fans-deliver.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+
Add Typography updates post markdown file to polaris.shopify.com

polaris-for-figma/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [#6711](https://github.com/Shopify/polaris/pull/6711) [`c2ffb9762`](https://github.com/Shopify/polaris/commit/c2ffb976216bfaded2c3b8d4ea0e5c82543a5cd6) Thanks [@SimonLeclercq](https://github.com/SimonLeclercq)! - - Modification of the documentation mentioning the use of a non-existent script
88
- Added documentation for a build script
9+
910
- Updated dependencies [[`720d10e79`](https://github.com/Shopify/polaris/commit/720d10e79c9080efccb4c1d3e41ac322b58b7977), [`e58092acb`](https://github.com/Shopify/polaris/commit/e58092acb10ddc8330dcd8fc4bd7293ba94692ad), [`3b6d6949f`](https://github.com/Shopify/polaris/commit/3b6d6949fdbb1d809f6aff5d3f36b897c0fd2353), [`6fab899c1`](https://github.com/Shopify/polaris/commit/6fab899c1a11b19640845b4a57ce82173bc27097)]:
1011
- @shopify/polaris@9.21.0
1112

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
name: Typography updates
3+
keywords:
4+
- typography
5+
- type
6+
- fonts
7+
- text
8+
- type styles
9+
---
10+
11+
# Polaris typography updates
12+
13+
Learn about what changes are coming to Polaris typography
14+
15+
![Screen showing the new type styles](/images/updates/[email protected])
16+
17+
---
18+
19+
This is an Alpha release of the new type system. That means we’re making the new Text component and Figma text styles available to use but there could still be significant changes made. Our goal is to share the work so that you can: **understand what’s changing**, **start using the typography updates**, and **provide feedback to help us improve.**
20+
21+
Ready to learn what’s changing? Let’s dive in!
22+
23+
## Why are we making changes?
24+
25+
As the Shopify admin gets more and more merchants using it to run their businesses, we need to evolve to feel less like a website and more like a power tool. In order to do this, we need to establish a strong foundation at the center of our design system and typography plays an important role.
26+
27+
Earlier this year, we invested a lot of time in [building up our design tokens](https://ux.shopify.com/putting-the-system-back-in-our-design-system-b2c55a392dea) as a first step in strengthening the foundation and increasing Polaris token coverage. After that release, we saw that there was still only ~8% coverage of typography in custom components in `shopify/web`.
28+
29+
A lack of flexibility in our 7+ typography components, little guidance on how to design with typography, and a lack of range in font weights and sizes is leading teams to diverge from Polaris and create new components or hard coded css values for type.
30+
31+
Simplifying our components and improving our foundation will help our product teams make significant and sweeping changes quickly across Shopify’s admin.
32+
33+
## What's changing
34+
35+
### Type styles
36+
37+
Polaris typography is getting a refresh. Currently, there are **4 Display**, **1 Heading**, **1 Subheading**, **1 Button**, **1 Body**, and **1 Caption** variants.
38+
39+
The updates will simplify type 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 UI.
40+
41+
![Screen showing the differences between the new type styles and the old type styles](/images/updates/[email protected])
42+
43+
## Type scale
44+
45+
We’ve updated the type scale and we’re moving from two scales to one for both desktop and mobile web. Some values have been removed and others added to cover a wide range of uses in the UI.
46+
47+
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. For example, if I take my base value of 14px and multiply it by 1.2 I get a value of 16px as the next increment in the scale.
48+
49+
| New scale | Old scale | |
50+
| --------- | --------- | ---- |
51+
| 12px | 12px | 13px |
52+
| 14px | 14px | 15px |
53+
| 16px | 16px | 16px |
54+
| 20px | 20px | 17px |
55+
| 24px | 26px | 21px |
56+
| 28px | 28px | 24px |
57+
| 32px | 42px | 27px |
58+
| 40px | - | - |
59+
60+
### Why were values changed or removed?
61+
62+
The lower end of the scale has largely stayed the same with the majority of the changes made to the middle and upper values.
63+
64+
**Changing values**
65+
The first change we made was updating the values of both size and line-height to be multiples of 4 with the exception of the 14px base size. This helps us be critical about the size values we use for other elements in the UI. This is important because it affects the rhythm of the page.
66+
67+
**Adding values**
68+
We added `32px` to have an extra step at the larger end of the scale. We made this decision after looking at what font sizes are being used across the different pages in the Shopify admin. Pages that are geared towards learning or celebrating key moments, often use the larger sizes in the scale. We also found that additional sizes were being added or adjusted with custom styles.
69+
70+
We considered those common values that we were noticing being added and adjusted the scale to work for those different pages.
71+
72+
### Why one type scale?
73+
74+
We’re moving from two type scales to one for both desktop and mobile web.
75+
76+
We looked at how type changes between the different screen sizes and found that it’s often a difference of `1px`. While `1px` can make a visual difference, after talking to designers and developers, we came to the conclusion that the added complexity of having two distinct scales and two sets of text styles, just wasn’t worth it. They often didn’t even realize a change in size happened or expected the size to actually decrease instead of increase as it does now.
77+
78+
However, for the larger sizes in the scale, we believe, in most cases, it makes sense for those sizes to adjust automatically so the sizes look appropriate for the screen size they’re being displayed on. This behavior hasn’t been added yet but, in the next release, we’ll update the larger styles to respond automatically at certain breakpoints with all other sizes staying the same unless specified otherwise.
79+
80+
![Screen showing how type styles adapt at different screen sizes](/images/updates/[email protected])
81+
82+
## Typography components
83+
84+
We’re moving from seven type components to a singular Text component.
85+
86+
## Why one component?
87+
88+
To start, the team prototyped both a singular and multiple component approach. We then tested these prototypes with developers and the response was overwhelmingly in favor of the singular Text component.
89+
90+
Overall, developers perceived the singular component as easier to use and understand. They could type in a property and see all the possible options right from their code editor. They didn’t have to import 7+ components and figure out the right one to use.
91+
92+
Other benefits of the singular component:
93+
94+
- One component to learn and read documentation on
95+
- Autocompleting props helps developers to learn the different typography options quickly
96+
- Less complexity in code
97+
- Decouples layout from type
98+
- Easier to make sweeping changes to type
99+
- Provides us with a more flexible way to control type within components
100+
- Sets us up for future style override work to provide even more flexibility
101+
- Provides one way to control typography
102+
- There is low usage of a lot of the old typography components
103+
104+
## Typography tokens
105+
106+
We have updated and streamlined token values, and updated token names to reflect a token naming convention that makes tokens easier to use and understand.
107+
108+
### Font-size tokens
109+
110+
We updated the size tokens to use increments of 100 for the variants. This allows us to set `--p-font-size-100` as the base and go lower (` --p-font-size-75` ) or higher (`--p-font-size-200`) as needed numerically.
111+
112+
| New token | Old token | px value | rem value |
113+
| ----------------- | ---------------- | -------- | --------- |
114+
| --p-font-size-75 | --p-font-size-1 | 12 | 0.75 |
115+
| - | --p-font-size-2 | 13 | 0.8125 |
116+
| --p-font-size-100 | --p-font-size-3 | 14 | 0.875 |
117+
| - | --p-font-size-4 | 15 | 0.9375 |
118+
| --p-font-size-200 | --p-font-size-5 | 16 | 1 |
119+
| - | --p-font-size-6 | 17 | 1.0625 |
120+
| --p-font-size-300 | --p-font-size-7 | 20 | 1.25 |
121+
| - | --p-font-size-8 | 21 | 1.3125 |
122+
| --p-font-size-400 | --p-font-size-9 | 24 | 1.50 |
123+
| - | --p-font-size-10 | 26 | 1.625 |
124+
| - | --p-font-size-11 | 27 | 1.6875 |
125+
| --p-font-size-600 | --p-font-size-12 | 28 | 1.75 |
126+
| --p-font-size-500 | - | 32 | 2 |
127+
| --p-font-size-700 | - | 40 | 2.5 |
128+
129+
### Line-height tokens
130+
131+
| New token | Value | Old token | Value |
132+
| ----------------- | ----- | ---------------------- | ----- |
133+
| --p-line-height-1 | 16 | --p-font-line-height-1 | 16 |
134+
| --p-line-height-2 | 20 | --p-font-line-height-2 | 20 |
135+
| --p-line-height-3 | 24 | --p-font-line-height-3 | 24 |
136+
| --p-line-height-4 | 28 | --p-font-line-height-4 | 28 |
137+
| --p-line-height-5 | 32 | --p-font-line-height-5 | 32 |
138+
| --p-line-height-6 | 40 | --p-font-line-height-6 | 36 |
139+
| --p-line-height-7 | 48 | --p-font-line-height-7 | 44 |
140+
141+
## Using the typography updates
142+
143+
The new Text component and Figma text styles are available in alpha. You can start using the new component and styles now but be aware they’re still in development and there could be breaking changes. The existing type components will continue to be available for use until the new Text component is finalized.
144+
145+
As you start to use the new component, please share feedback with the Polaris team to help us continuously improve the type system.
146+
147+
## What’s next?
148+
149+
Next, we’ll be releasing the beta version of the component. The beta release will include:
150+
151+
- Updating Polaris components to use the new Text component
152+
- Adding a deprecation warning to the old type components
153+
- Adding responsive styles
154+
- Updating components in the Figma UI Kit to use the new text styles
155+
- Updating design and API documentation
156+
157+
Don’t worry, we’ll also provide a timeline and guidance for migration.
158+
159+
## Resources
160+
161+
- [Text component](http://localhost:3000/components/text)
162+
- [Figma text styles](https://www.figma.com/file/tbm3yEIZsOuHS7xJu9zy6Q/text-styles?node-id=5457%3A5710)
163+
- [Figma guides](https://www.figma.com/file/tbm3yEIZsOuHS7xJu9zy6Q/text-styles?node-id=5523%3A51)
286 KB
Loading
64.1 KB
Loading
362 KB
Loading

0 commit comments

Comments
 (0)