If you are not importing any element themes, and want to use the font properties, you need to import them manually.
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.
The Roboto font is used by default. You can apply or change the font family using the --material-font-family
custom property.
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:
The following font sizes are available to use. The default font size for most elements is --material-body-font-size
.