gpt4 book ai didi

angular - 在 Angular Material 中使用两种不同的字体

转载 作者:行者123 更新时间:2023-12-02 18:58:21 27 4
gpt4 key购买 nike

我使用自定义字体创建了自己的自定义主题:

@import '~@angular/material/theming';
@include mat-core();
$custom-typography: mat-typography-config($font-family: '"work sans", sans-serif;');
@include mat-core($custom-typography);

现在我想为每个标题(h1-h6)使用字体“Oswald”。我该怎么做?

最佳答案

可以为每个排版级别配置不同的字体。像这样的事情:

@import '~@angular/material/theming';


$custom-typography: mat-typography-config(
$font-family: 'default font',
$headline: mat-typography-level(112px, 112px, 300, 'another font'),
$title: mat-typography-level(56px, 56px, 400, 'and another font'),
);
@include mat-core($custom-typography);

Angular Material documentation没有显示font-family参数,但是可以看到in the source code .

关于angular - 在 Angular Material 中使用两种不同的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53277193/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com