Text color of mat-chip in Material from html markup

Discussão em 'Angular' iniciado por smcoder, Setembro 5, 2025.

  1. smcoder

    smcoder Guest

    How can I override the text color of the mat-chip component?

    [style.background] works

    [color]="'white'" doesn't - here would be 'label.color2' used

    <tr *ngFor="let label of labels">
    <td>
    <mat-chip [style.background]="label.color" [color]="'white'">
    {{ label.labelName }}
    </mat-chip>
    ...


    I found the way to override it from CSS, but in my case, the color needs to be dynamic. Reference: https://material.angular.dev/components/chips/styling

    Continue reading...

Compartilhe esta Página