代码之家  ›  专栏  ›  技术社区  ›  Dachstein

在Angular styles.scss@extend元素中使用导入的css库?

  •  0
  • Dachstein  · 技术社区  · 7 年前

    styles.scss

    @import '~tachyons/css/tachyons.css';
    
    body {
      @extend .w-100;
    }
    

    但当我叫ng serve时,它失败了:

    "body" failed to @extend ".w-100". The selector ".w-100" was not found.

    但是班级 .w-100

    1 回复  |  直到 7 年前
        1
  •  2
  •   Dachstein    7 年前

    我没有导入超光速粒子的css版本,而是导入了sass版本。

    @import '~tachyons-sass/tachyons.scss';
    
    body {
      @extend .w-100;
    }
    

    不管怎样,现在可以了。

    推荐文章