【问题标题】:Angular scss use @import scss file inside classAngular scss 在类中使用@import scss 文件
【发布时间】:2022-06-14 21:00:23
【问题描述】:

我正在使用 Angular 13,我正在尝试在我的 styles.scss 中:

body.theme1 {
    @import "./assets/themes/theme1.scss";
}

然后在我的 app.component.html 我有:

<div class="theme1">

    // HTML HERE

</div>

这不是在导入文件。

这可以吗?如果有怎么办?

【问题讨论】:

    标签: css angular sass angular13


    【解决方案1】:

    您在 example 中将 theme1 类应用于 div 元素,但在 styles.scss 中您将此类应用于 body 元素

    【讨论】:

      猜你喜欢
      • 2020-01-28
      • 2020-01-18
      • 2020-05-13
      • 2016-02-20
      • 2018-04-27
      • 2021-11-06
      • 2019-04-24
      • 2019-09-27
      • 1970-01-01
      相关资源
      最近更新 更多