Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When applying a theme like below:
@use '@angular/material' as mat;
body {
// font-family: Roboto, 'Helvetica Neue', sans-serif;
@include mat.theme(
(
color: (
theme-type: light,
primary: mat.$spring-green-palette,
),
typography: Roboto,
density: 0,
)
);
}
html {
height: 100%;
}
Without the commented code in body tag, the h1 to h6
tags do not have the default font-family.
In the old method we had the typography-hierarchy
, set this up and it works great:
@use '@angular/material' as mat;
$theme: mat.define-theme(
(
color: (
theme-type: light,
primary: mat.$spring-green-palette,
),
typography: (
plain-family: Roboto,
brand-family: Open Sans,
bold-weight: 900,
medium-weight: 500,
regular-weight: 300,
),
density: (
scale: 0,
),
)
);
body {
@include mat.core();
@include mat.all-component-themes($theme);
}
@include mat.typography-hierarchy($theme);
html {
height: 100%;
}
So the question is how to define the typography for h1-h6
with mat.theme(
Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
Expected Behavior
way to configure typography with define-theme
Actual Behavior
no way to configure typography with define-theme
Environment
- Angular: 19
- CDK/Material:19
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows