自定义主题失败
来源:2-8 Angular Material 主题

dds813
2017-09-19
@import '~@angular/material/theming'; // 导入material的主题支持
@include mat-core(); // 将material中公用的风格包含进来
// 接下来自定义主题
$my-app-primary: mat-palette($mat-indigo);
$my-app-accent: mat-palette($mat-pink, A200, A100, A400);
// 后面的三个参数分别为 A200 默认颜色亮度 A100 亮时颜色亮度 A400 是暗时颜色亮度
$my-app-warn: mat-palette($mat-red);
$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent, $my-app-warn);
$include angular-material-theme();
提示
ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module build failed:
$include angular-material-theme();
^
Expected ':' after $include in assignment statement
in D:\apache2\www\scss\src\theme.scss (line 14, column 1)
Error:
$include angular-material-theme();
^
Expected ':' after $include in assignment statement
in D:\apache2\www\scss\src\theme.scss (line 14, column 1)
at options.error (D:\apache2\www\scss\node_modules\node-sass\lib\index.js:291:26)
@ ./src/styles.scss 4:14-187
@ multi ./src/styles.scss
1回答
-
dds813
提问者
2017-09-19
搞定了,是我的include前面加了$ ,写成了$include,应该是@include ,所以报错了
10
Angular打造企业级协作平台,让你在Angular领域中出类拔萃
998 学习 · 536 问题
相似问题