css - Sass 错误 : Invalid CSS after "typography-config" angular 4. x

标签 css angular sass angular-material2

我想为 Assets 文件夹中的 Angular 4.x 元素集成我的自定义字体。我正在使用 Angular Material 。所以对于 Material ,我在我的 styles.sass 中设置自定义排版

代码如下:

@import '~@angular/material/theming'

$used-fonts : 'Avenir', arial

$general-typography : mat-typography-config(
  $font-family: quote($used-fonts)
)

@include mat-core($general-typography)

我得到的错误:

Invalid CSS after "...ography-config(": expected expression (e.g. 1px, bold), was "{"

处给我一个错误:

有什么想法吗?

最佳答案

我建议你应该在一行内尝试。它会将其视为嵌套值

$general-typography : mat-typography-config($font-family: quote($used-fonts))

关于css - Sass 错误 : Invalid CSS after "typography-config" angular 4. x,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47304406/

相关文章:

html - 在页脚中放置 4 个带有文本的框

css - 带三 Angular 形的响应式按钮

html - 记住电子邮件和密码

javascript - 如何在不禁用所有文本选择的情况下使用 shift 禁用文本选择?

css - SCSS 扩展 :after with :before

angular - 使用 templateRef 查看Children

angular - Angular 5 上的 HTTP header

javascript - 在 Angular 模块中导出枚举

css - 如何在 SASS 中编写带有箭头符号的嵌套 CSS 类?

css - 为什么 ionic 设置网格 `.col` `display:block` 和 `width: 100%` 属性?