Can I change the color of Angular Material checkbox with some custom color and how?

后端 未结 7 1970
盖世英雄少女心
盖世英雄少女心 2020-12-28 16:10

I\'m trying to do this, but is looks like it is only possible to change it to primary or warn.

7条回答
  •  清酒与你
    2020-12-28 16:16

    You may use this:

    ::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background, .mat-accent .mat-pseudo-checkbox-checked, .mat-accent .mat-pseudo-checkbox-indeterminate, .mat-pseudo-checkbox-checked, .mat-pseudo-checkbox-indeterminate {
        background-color: red !important; /* Red background for example */
    }
    

提交回复
热议问题