Is there a way to change the text color when a row is selected in my application? I have already figured out how to change the background color of the row, but how can I target the text within the cells?
I'm considering using a similar approach to the highlight method I used before, but I'm not sure what to specify to select the text inside the row cells.
This is my HTML:
<mat-row *matRowDef="let row; columns: displayedColumns" [ngClass]="{'highlight': selectedRowIndex == row.containerNo}"
(click)="highlight(row)"
(click)="openCentred(content)">
</mat-row>
In my TypeScript file:
selectedRowIndex: number = -1;
highlight(row) {
this.selectedRowIndex = row.containerNo;
}
And here is my CSS:
.highlight {
background:#286090; /* darkblue */
}
Any suggestions on how to change the text color of the selected row?
Thanks for your help!
Best regards,
Rasmus