1)我创建了这个文件src / theming.scss
@import '~@angular/material/theming';
@include mat-core();
$primary: mat-palette($mat-light-blue);
$accent: mat-palette($mat-amber , 700, A100, A400);
$theme: mat-light-theme($primary, $accent)
2)我把它添加到.angular-cli.json
"prefix": "app",
"styles": [
"theming.scss",
"styles.css"
],
3)哦,亲爱的...我的他妈的没有露出......一个令人讨厌的灰色......
<button mat-button color="primary" (click)="add()">Add Point!</button>
逻辑将决定颜色应该是浅蓝色......
答案 0 :(得分:2)
您需要在angular-material-theme
中加入主题。在theming.scss
文件的末尾执行以下操作:
@include angular-material-theme($theme);