【问题标题】:Scss url() resolves relative to imported scss filesscss url() 相对于导入的 scss 文件解析
【发布时间】:2020-08-10 12:47:19
【问题描述】:

我们目前正在我们的应用程序中实施 Prime ng。我已经在 angular.json 中的 style 标签下引用了 scss 文件。我查看了引用的 scss,它还包含多个 scss 导入。就像来自不同文件夹的@import _layout.scss。问题是这些导入的 scss 文件url("../images/special/#{$horizontalMenuBgImageLight}") 中使用的资产是相对于它们所在的文件解析的,而不是相对于我在 style 标签下的 angular.json 中引用的主 scss。 所以我收到这些资产的“无法解决”错误。我可以将文件夹移动到所需的位置,但我想知道这是否是正确的解决方案,因为文件夹结构是由这样的 Prime ng 设置的。

【问题讨论】:

    标签: angular sass primeng


    【解决方案1】:

    我发现从 Angular 10 开始,我所描述的行为是默认行为。 更多上下文:https://github.com/angular/angular-cli/pull/17537

    【讨论】:

      猜你喜欢
      • 2013-12-28
      • 2017-08-09
      • 2020-02-11
      • 2020-01-15
      • 2018-08-17
      • 2019-08-21
      • 2018-09-23
      • 1970-01-01
      • 2020-05-13
      相关资源
      最近更新 更多