When I customize the theme to set a font...
<mat-card-title> <mat-card-action>
etc)<p> <span> <mat-card-content>
) and default to Roboto... Shouldn't those take the body-1 style? Note that I am using mat-card as an example, but the same happens with other components.
https://material.angular.io/guide/typographyMinimal steps to repro:
$theme-primary: mat.define-palette(mat.$indigo-palette);
$theme-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
$my-typography: mat.define-typography-config(
$font-family: "'Nerko One', cursive",
);
$theme: mat.define-light-theme(
(
color: (
primary: $theme-primary,
accent: $theme-accent,
),
typography: $my-typography,
)
);
@include mat.all-component-themes($theme);
Here is an example, you can see that the title etc are styled, but not the content of the card: https://stackblitz.com/edit/angular-wan6f9?file=src/app/card-actions-example.html
I tried a few approaches, including configuring each level which did not work. The only thing that works is to hardcode the default to the root of the document, which I would rather not do.
I had exactly the same symptoms and desperately added
@include mat.all-component-typographies($typography);
in addition to the @include mat.all-component-themes($my-theme);
present in the documentation.
Where $typography
is basically the same as described by the OP.
Then all the styles kicked in as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With