【发布时间】:2019-07-08 10:52:18
【问题描述】:
在使用 Angular CLI 生成新项目并选择 SASS 之后:
Which stylesheet format would you like to use? SASS [ http://sass-lang.com ]
用 ng 添加材料:
ng add @angular/material
最后生成材质的导航栏组件:
ng generate @angular/material:materialNav --name=main-nav
给我们一个带有 css 语法的 main-nav.component.sass:
.sidenav-container {
height: 100%;
}
.sidenav {
width: 200px;
}
.sidenav .mat-toolbar {
background: inherit;
}
.mat-toolbar.mat-primary {
position: sticky;
top: 0;
z-index: 1;
}
有人知道是否可以使用 sass 语法从 @angular/material 生成?
谢谢
【问题讨论】:
-
有一个github问题Material schematics don't support legacy "Sass" format。 @jelbourn 在哪里说
We currently only support the more recent `.scss` format (or anything that's a superset of css)。他们的计划是If the user's project is configured to use `.sass` (not `.scss`) or Stylus, we should emit plain CSS files,见:github.com/angular/material2/issues/15164 -
好的,这就是原因,谢谢你fridoo
标签: angular sass angular-schematics