2017-10-06 139 views
0

1)I創建該文件的src/theming.scssangular2材料主題化不起作用

@import '[email protected]/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)I將此添加到.angular-cli.json

"prefix": "app", 
    "styles": [ 
    "theming.scss", 
    "styles.css" 
    ], 

3)哦天......我themimg不showing..its AA令人討厭的灰色......

<button mat-button color="primary" (click)="add()">Add Point!</button> 

邏輯將決定了色彩要淡藍色...

回答

2

您需要在angular-material-theme中包含您的主題。在theming.scss文件末尾執行以下操作:

@include angular-material-theme($theme);