Material

Typography

Importing the style module

If you are not importing any element themes, and want to use the font properties, you need to import them manually.

Global typography styles

To easily apply basic typographic styles for your app, include the following style module in the global scope. It will set the font family, font size and line height for the body element, as well as specify consistent header styles (it doesn’t override header margins).

If needed, you can include the style module in any other style scopes (i.e. shadow roots) as well.

Font family

The Roboto font is used by default. You can apply or change the font family using the --material-font-family custom property.

Roboto font

The Roboto font is not imported by default, but only used if found from the users system. If you wish to use the Roboto font for all users, you need to import it manually. You can include the following snippet in your app to easily import it from Google Fonts:

Font size

The following font sizes are available to use. The default font size for most elements is --material-body-font-size.

Custom properties

Font family
--material-font-family
Font size
--material-display2-font-size
--material-display1-font-size
--material-headline-font-size
--material-title-font-size
--material-subhead-font-size
--material-body-font-size
--material-small-font-size
--material-caption-font-size
--material-icon-font-size