How can I change the color of selected option of mat-list-option
?
Right now I have something like this:
I want to change the color of whole option or card 'on select' to green. Something like this:
My code is like this:
<mat-selection-list #list>
<mat-list-option *ngFor="let yuvak of yuvaks">
{yuvak.name}
{yuvak.phonenumber}
</mat-list-option>
</mat-selection-list>
You can use aria-selected="true"
attribute from mat-list-option
tag to target the selected option,
and provide corresponding css properties for the same.
mat-list-option[aria-selected="true"] {
background: rgba(0, 139, 139, 0.7);
}