As per angular material typography there are 13 defined levels for typography: Documentation.
For example display-4, display-3, display-2, headline, title, etc.
By default these level has some predefined font-size, line-height and letter-spacing. We can customize font for each level as below:
@import '~@angular/material/theming';
// Define a custom typography config that overrides the font-family as well as the
// `headlines` and `body-1` levels.
$custom-typography: mat-typography-config(
$font-family: 'Roboto, monospace',
$headline: mat-typography-level(32px, 48px, 700),
$body-1: mat-typography-level(16px, 24px, 500)
$caption: mat-typography-level(10px, 16px, 400),
);
// Override the typography in the core CSS.
@include mat-core($custom-typography);
For example if I have caption-large level in my project styleguide how can I add that level to customization function?
I can do this by defining my own CSS classes, but is there any sophisticated way to do that?
You can't do this out of the box with Angular. You need two steps.
These can then be used like: