【问题标题】:Why is Angular breaking my Google Fonts SCSS import?为什么 Angular 会破坏我的 Google 字体 SCSS 导入?
【发布时间】:2020-11-14 14:32:35
【问题描述】:

我的全局 SCSS 上有这条线:

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;400;700&family=Roboto&display=swap');

但由于某种原因,URL 以某种方式被 Angular 截获,并且浏览器发出的请求被更改:

显然,Google 字体最终会返回 400 HTTP 状态。

【问题讨论】:

标签: angular google-fonts


【解决方案1】:

我遇到了同样的问题,最后我决定停止在 scss 中导入并添加到 index.html 中

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&amp;display=swap" rel="stylesheet">

【讨论】:

    猜你喜欢
    • 2020-03-04
    • 2021-10-08
    • 1970-01-01
    • 1970-01-01
    • 2013-06-21
    • 2013-06-25
    • 2013-06-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多