A standard scale and basic definitions for your text: font family
,weight
and sizes
.
font family
,weight
and sizes
.Font Family
Global Token | Value |
---|---|
--fs-text-face-body | -apple-system, system-ui, BlinkMacSystemFont, sans-serif |
--fs-text-face-title | var(--fs-text-face-body) |
Weights
Global Token | Value |
---|---|
--fs-text-weight-light | 300 |
--fs-text-weight-regular | 400 |
--fs-text-weight-medium | 500 |
--fs-text-weight-semibold | 600 |
--fs-text-weight-bold | 700 |
--fs-text-weight-black | 900 |
Typography Scale
Mobile Scale
- 12
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 14
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 16
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 18
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 20
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 23
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 26
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 29
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Desktop Scale
- 12
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 14
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 16
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 20
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 25
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 31
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 39
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 48
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- 61
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Global Token | Value |
---|---|
--fs-text-size-base | 16px |
--fs-text-scale-desktop | 4px |
--fs-text-scale-mobile | 2px |
--fs-text-size-0 | 12px |
--fs-text-size-1 | 14px |
--fs-text-size-2 | var(--fs-text-size-base) |
--fs-text-size-3 | calc(var(--fs-text-size-2) + var(--fs-scale)) |
--fs-text-size-4 | calc(var(--fs-text-size-3) + var(--fs-scale)) |
--fs-text-size-5 | calc(var(--fs-text-size-4) + var(--fs-scale)) |
--fs-text-size-6 | calc(var(--fs-text-size-5) + var(--fs-scale)) |
--fs-text-size-7 | calc(var(--fs-text-size-6) + (var(--fs-scale) * 2)) |
--fs-text-size-8 | calc(var(--fs-text-size-7) + (var(--fs-scale) * 2)) |
--fs-text-size-9 | calc(var(--fs-text-size-8) + (var(--fs-scale) * 2)) |
Semantical tokens
Sizes
Global Token | Value |
---|---|
--fs-text-size-title-huge | var(--fs-text-size-8) |
--fs-text-size-title-page | var(--fs-text-size-7) |
--fs-text-size-title-product | var(--fs-text-size-4) |
--fs-text-size-title-section | var(--fs-text-size-4) |
--fs-text-size-title-subsection | var(--fs-text-size-4) |
--fs-text-size-title-mini | var(--fs-text-size-4) |
--fs-text-size-lead | var(--fs-text-size-3) |
--fs-text-size-menu | var(--fs-text-size-base) |
--fs-text-size-body | var(--fs-text-size-base) |
--fs-text-size-legend | var(--fs-text-size-1) |
--fs-text-size-tiny | var(--fs-text-size-0) |
Max Lines
Global Token | Value |
---|---|
--fs-text-max-lines | 2 |
Adding a custom font
- Go to the
src
folder and create thefonts
folder. - Inside the
src/fonts
folder, create a newWebFonts.tsx
file and add a<link>
tag for yourfont-family
of choice as in the example below.
_15/* eslint-disable @next/next/no-page-custom-font */_15_15function WebFonts() {_15 return (_15 <>_15 {/* Add a <link> tag for your font-family of choice */}_15 <link_15 rel="stylesheet"_15 href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"_15 />_15 </>_15 );_15}_15_15export default WebFonts;
- In your custom theme file, usually
src/themes/custom-theme.scss
, use the--fs-text-face-body
token with thefont-family
you chose.
We recommend using fallback fonts as system fonts to ensure quick rendering, consistent and readable content.
_10@layer theme {_10 .theme {_10 // --------------------------------------------------------_10 // Typography (Branding Core)_10 // --------------------------------------------------------_10 --fs-text-face-body: 'Inter', -apple-system, system-ui, BlinkMacSystemFont, sans-serif;_10 }_10}
- Run
yarn dev
and check the browser to see the newfont-family
applied.