【发布时间】:2020-07-31 23:12:00
【问题描述】:
我需要更改此 css 代码的背景颜色
.mat-toolbar.mat-primary {
背景
: #d12626; 颜色:#fff; }
.mat-toolbar.mat-primary {
background: #d12626;
color: #fff;
}
我需要为上面的代码更改background。如何做到这一点
我试过了
[ngStyle]=' .mat-toolbar.mat-primary {
background: #d12626;
color: #fff;
}
'
但不工作
然后我从 stackoverflow 得到另一个建议
[style.font-size]="fontSize+'px'" this code is working for 'font-size' but not woking for my need code this is my need [style.mat-toolbar.mat-primary.background]='#d12626'; but not working
我用过这个
.mat-toolbar.mat-primary {
background: #d12626;
color: #fff;
}
CSS 代码中的代码,它正在工作,但我需要动态更改颜色。
我还需要更新他的颜色
原色
主光色
主要深色
次要颜色
二次光色
次深颜色
主文本颜色
二级文本颜色
【问题讨论】:
标签: css angular angular-material angular8