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
{{ message }}
Repository navigation
Commit 32cd571
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: site/app/[locale]/guide/typography/content.mdx
+60-21Lines changed: 60 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ import FontFamilyBasicUsage from '../../reference/font-family/components/BasicUs
10
10
11
11
## Overview [sr-only]
12
12
<Overview />
13
+
The typography system in Master CSS provides a cohesive and scalable approach, [`text:<size>`](/guide/typography#text-scale), to setting text styles. It combines **font size**, **line height**, and **letter spacing** into unified tokens to ensure consistency and visual rhythm across interfaces—from fine print to large headlines.
13
14
14
15
### Namespaces for typography
15
16
The typography system is built on a set of [variables](/guide/variables) that are organized into namespaces. This allows for easy customization and consistent application across your design.
@@ -22,6 +23,65 @@ The typography system is built on a set of [variables](/guide/variables) that ar
22
23
23
24
---
24
25
26
+
## Text scale
27
+
At its core, the system is powered by a semantic type scale (`text:3xs` to `text:10xl`) and corresponding font utilities (`font:*`, `line:*`, `tracking:*`) defined through design tokens. These values are carefully calibrated—not just mathematically scaled—to produce an optimal reading experience.
28
+
29
+
Rather than manually composing multiple properties, you can use `text:<size>` to apply all three attributes—**font-size**, **line-height**, and **letter-spacing**—with a single class, tuned to the specific needs of each text scale.
30
+
31
+
*`text:3xs ~ text:xs` — For fine print, annotations, captions, or table labels
32
+
*`text:sm ~ text:lg` — Standard text sizes for body copy, paragraphs, and buttons
33
+
*`text:xl ~ text:3xl` — Ideal for subheadings, lead paragraphs, or callouts
34
+
*`text:4xl ~ text:10xl` — Reserved for large headings, page titles, and hero sections
35
+
36
+
See some classic examples in the following sections. All examples use `text:<size>`, which automatically applies the ideal font size, line height, and letter spacing in a single utility.
37
+
<BodyText />
38
+
<Headings />
39
+
<PageTitles />
40
+
41
+
### Without vs With `text:<size>`
42
+
Manually configuring typography often requires juggling multiple CSS properties like `font-size`, `line-height`, and `letter-spacing`. This can quickly become inconsistent, especially when reused across different components or pages.
You may also find yourself tweaking these values individually for each heading or paragraph, which increases cognitive load and the risk of visual inconsistency.
63
+
64
+
(o) Using `text:3xl` utility token
65
+
```html
66
+
<h1class="text:3xl">...</h1>
67
+
```
68
+
69
+
The `text:lg` token applies a finely tuned combination of:
70
+
71
+
<Class2CSS>{'text:3xl'}</Class2CSS>
72
+
73
+
All values are calibrated to provide optimal readability and consistent rhythm across the type scale. No manual calculation, no guesswork—just a reliable, semantic shortcut.
74
+
75
+
Why this matters? Using `text:<size>` ensures:
76
+
77
+
***Consistency** — every instance of `text:lg` looks exactly the same
78
+
***Maintainability** — no need to audit multiple values across stylesheets
79
+
***Scalability** — easier to theme or adjust from a central design token
80
+
81
+
Whenever possible, prefer `text:<size>` over ad hoc styles. It’s faster, safer, and makes your typography systematically predictable.
82
+
83
+
---
84
+
25
85
## Type scale
26
86
The font scale ranges from `font:3xs` to `font:10xl`, with each size intentionally designed to deliver visual harmony and clear hierarchy across a variety of use cases.
27
87
<FontSizeBasicUsage />
@@ -55,24 +115,3 @@ Our typography system defines a semantic range of font weight tokens, from `font
55
115
56
116
## Letter spacing
57
117
<LetterSpacingBasicUsage />
58
-
59
-
---
60
-
61
-
## Text scale
62
-
However, when setting font size, you typically want to pair it with a corresponding line height. Smaller text sizes use taller line-heights to improve legibility, while larger sizes use tighter spacing to maintain compactness and strong hierarchy.
63
-
64
-
In our [`text:<size>`](/reference/text-size) system, each size from `text:3xs` to `text:10xl` has a carefully adjusted line-height to achieve balanced readability and visual harmony. These values are not uniform ratios—they're intentionally tuned to suit the visual characteristics of each text scale.
65
-
66
-
*`text:3xs ~ text:xs` Used for fine print, annotations, captions, or table labels
67
-
*`text:sm ~ text:lg` Standard text sizes for body copy, paragraphs, and buttons
68
-
*`text:xl ~ text:3xl` Ideal for subheadings, lead paragraphs, or callouts
69
-
*`text:4xl ~ text:10xl` Reserved for large headings, page titles, and hero sections
70
-
71
-
See some classic examples in the following sections.
0 commit comments