next,我根据文档设置了一个自定义主题,我的主题声明看起来像:
@use "@angular/material" as mat;
html {
@include mat.theme(
(
color: (
theme-type: light,
primary: mat.$spring-green-palette,
),
typography: Roboto,
density: 0,
)
);
}
也遵循材料文档,将机器人字体添加到我的元素中。之后,材料组件具有正确的字体和版式,但是“普通”的html标签(如
<h1>
,
<p>
,等等)也没有。搜索了应应用的规则的预定义主题,如果我将其复制到我的主样式表,它们可以正常工作,但是即使在主题中设置了“ Typograpy”部分,自定义主题似乎也不包括在内config.screenshots显示了两种情况之间的差异:类似这样的方法(
mat.theme(