【问题标题】:Ionic build android --prod cleancss broken @import errorIonic build android --prod cleancss 损坏 @import 错误
【发布时间】:2017-01-18 11:42:27
【问题描述】:

我正在尝试在我的应用程序中使用自定义字体。我有 2 种字体,一种是来自 flaticons 的图标字体,另一种是文本字体“Humanst webfont”,我已经下载了它们并遵循了很多关于如何使它们工作的教程,这是我到目前为止所得到的:

错误: Erro thrown of broken import

我的项目文件夹:THE SRC AND WWW FOLDERS

我的 app.scss 中有这个:

@import "../assets/fonts/humanst-webfont.css";
@import "../assets/fonts/flaticon.css";

这是我的human-webfotn.css:

@font-face {
  font-family: 'Humanst';
  src: url('humanst-webfont.woff2') format('woff2'),
       url('humanst-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

我已尝试导入 .css、.scss 并仅允许 humant-webfont。也将我的 appscripts 更新为 1.0.0。 在离子服务中它工作正常,但是当我尝试构建它时它会中断。有人知道它是什么吗?

提前致谢:)

【问题讨论】:

    标签: android css ionic-framework sass ionic2


    【解决方案1】:

    我遇到了同样的问题。我最终将 css 放入 index.html 而不是变量文件中。 在生产构建和服务期间工作正常。

    【讨论】:

    • 这对我有用,带有@font-face 的简单样式标签就足够了。谢谢
    • 仍然如此,为什么 android build 不能包含 css 文件?我的项目中有 animate.css 并且我遇到了问题。对此有任何官方修复吗?
    猜你喜欢
    • 2019-10-05
    • 1970-01-01
    • 2019-04-19
    • 2023-03-31
    • 1970-01-01
    • 2020-09-07
    • 2018-05-12
    • 2019-06-27
    • 2018-12-14
    相关资源
    最近更新 更多