角材料-更改单击的垫列表选项的颜色 [英] Angular Material - change color of clicked mat-list-option
本文介绍了角材料-更改单击的垫列表选项的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以更改已选中复选框(mat-pseudo-checkbox-checked)的默认颜色:
Is there a possibility to change the default color of a checked checkbox (mat-pseudo-checkbox-checked):
<mat-selection-list #shoes>
<mat-list-option *ngFor="let shoe of typesOfShoes">
{{shoe}}
</mat-list-option>
</mat-selection-list>
我尝试过:
.mat-pseudo-checkbox-checked {
background-color: #00f;
}
但没有影响.
推荐答案
我不确定,但是您可以尝试使用此
I am not sure but you can try using this
.mat-select-content, .mat-select-panel-done-animating {
background: mat-color($background, card);
}
到
.mat-select-content, .mat-select-panel-done-animating {
background: mat-color($background, card);
.mat-option {
color : mat-color($foreground, text);
}
}
有关详细信息,您还可以检查以下链接 https://github.com/angular/material2/blob/master/src/lib/list/_list-theme.scss
for details, you can also check the following link https://github.com/angular/material2/blob/master/src/lib/list/_list-theme.scss
这篇关于角材料-更改单击的垫列表选项的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文