Open DzmVasileusky opened 3 weeks ago
I agree this is an area of improvement, in the meantime the customizable fields are here: https://material.angular.io/guide/typography#configuring-typography. This is how you apply it to your theme: https://material.angular.io/guide/theming#defining-a-theme
@amysorto But what about font-size, line-height, font-weight of specific typography levels? Why the customisation is so restricted? Can we really only choose font-family and font-weight for bold/medium now? Does it mean designers can't create their own typography now?
Ok, I could customise it by overriding css vars at least like this:
:root {
--mat-text-button-with-icon-horizontal-padding: 8px;
--mdc-text-button-label-text-size: 16px;
}
however it is a partial customisation it would be better if we could customise it more globally
Another option could be to enable system variables for the theme and then only change the system variables.
@crisbeto thanks, funny thing I didn't find docs on system variables on the official Angular material website but found it here https://angular-material.dev/articles/angular-material-theming-css-vars
Is it considered as a bad practice? Or are documents just not completed?
System variables are supported, we just haven't gotten around to writing a guide for them.
@crisbeto thank you, having a guide for that would be really helpful
Couldn't agree more the M3 custom schematic documentation is just as bad if not worse. In the age of AI, there's no excuse for such horrible, incomplete and just flat wrong documentation. Either be professional, or stop publishing libraries with crap docs.
I wrote an article about modifying typescales using CSS variables. You can read it here: https://angular-material.dev/articles/angular-material-18-typography
Documentation Feedback
Material 2 docs were pretty clear about how to customise typography.
The current page called "Customizing Typography" doesn't have an information on how to customise it at all. It describes the usage only.
Migration guide isn't answering this question as well (https://material.angular.io/guide/material-2-theming#how-to-migrate-an-app-from-material-2-to-material-3).
Affected documentation page
https://material.angular.io/guide/theming#customizing-your-typography