是否可以更改已选中复选框的默认颜色(mat-pseudo-checkbox-checked):
<mat-selection-list #shoes>
<mat-list-option *ngFor="let shoe of typesOfShoes">
{{shoe}}
</mat-list-option>
</mat-selection-list>
Run Code Online (Sandbox Code Playgroud)
我试过了:
.mat-pseudo-checkbox-checked {
background-color: #00f;
}
Run Code Online (Sandbox Code Playgroud)
但这没有影响。
小智 9
加class="mat-primary"进去就行<mat-list-option>
<mat-selection-list>
<mat-list-option class="mat-primary" checkboxPosition="before" *ngFor="let shoe of typesOfShoes">
{{shoe}}
</mat-list-option>
Run Code Online (Sandbox Code Playgroud)
输出:
小智 6
我不确定,但您可以尝试使用它
.mat-select-content, .mat-select-panel-done-animating {
background: mat-color($background, card);
}
Run Code Online (Sandbox Code Playgroud)
到
.mat-select-content, .mat-select-panel-done-animating {
background: mat-color($background, card);
.mat-option {
color : mat-color($foreground, text);
}
}
Run Code Online (Sandbox Code Playgroud)
有关详细信息,您还可以查看以下链接 https://github.com/angular/material2/blob/master/src/lib/list/_list-theme.scss
| 归档时间: |
|
| 查看次数: |
9584 次 |
| 最近记录: |