Skip to main content brightness_auto motion_photos_off palette download more_vert
toc

Typography

Typography helps make writing legible and beautiful.

Tip: "typeface" and "typescale" can be confusing. "face" refers to font-family and font-weight.

"scale" refers to a group of font-family, font-size, line-height, and font-weight tokens.

A typeface is a font-family. In Material there are plain and brand typefaces.

Each typeface has normal, medium, and bold styles (defaults to 400, 500, and 700). All three weight styles need to be included for a font.

Important: the default typeface is Roboto Flex, then Roboto. If you do not change it, load one of them. For example, from fonts.google.com.

Typefaces can be set using CSS custom properties. Tokens follow the naming convention --md-ref-typeface-<token>.

Typeface Token
Brand --md-ref-typeface-brand
Plain --md-ref-typeface-plain
HTMLCSS
<h2 class="brand">Inbox</h2>
<p class="plain">Three new messages.</p>

A typescale is a collection of font styles: font-family, font-size, line-height, and font-weight. They are organized into roles that describe their purpose.

Material's applying type guidelines explains when to use each typescale role.

The type scale is applied with the font shorthand tokens and their -axes and -tracking companions, which also work inside shadow roots.

HTMLCSS
<h1>Welcome back</h1>

The scale has five roles (display, headline, title, body, label), each in sm, md, and lg, plus emphasized styles per role. Tokens follow --md-sys-typescale-<role>-<size>-<property> with the properties font, size, line-height, weight, tracking, and axes; the bare --md-sys-typescale-<role>-<size> is the combined font shorthand.

Typescale Tokens
Display --md-sys-typescale-display-md-size, -line-height, -weight
Headline --md-sys-typescale-headline-md-size, -line-height, -weight
Title --md-sys-typescale-title-md-size, -line-height, -weight
Body --md-sys-typescale-body-md-size, -line-height, -weight
Label --md-sys-typescale-label-md-size, -line-height, -weight
Emphasized --md-sys-typescale-emphasized-<role>-<size>

Language height. Line heights adapt to the script. Set --md-sys-language-height-scale (1, 1.07, 1.3, or 2) on :root to change the default; text in languages such as Arabic, Thai, or Urdu picks up its height from :lang().

Your draft was saved to the inbox.

HTMLCSS
<p class="body">Your draft was saved to the inbox.</p>
Install Material Web 3.0

Your browser did not offer to install the docs as an app. Install them from the browser instead:

Close
Send feedback
Bug Documentation Idea

Opens a new GitHub issue for material-components/material-web in a new tab, with this filled in.

Cancel Open issue