I have a component using mat tab from angular material 7.
I want to change the background color of my tabs depending on a boolean value of my typescript variable.
The problem is that I can only apply the CSS on all tabs with
.mat-tab-label {
background-color: red;
}
How to create a CSS class which I can apply on a specific tab.
I have a standard component. I tried using encapsulation: ViewEncapsulation.None but this only allowed me to change all tabs as mentioned above.
HTML:
<mat-tab-group mat-align-tabs="center" dynamicHeight="true">
<mat-tab label="tab1">
Hello
</mat-tab>
<mat-tab label="tab2">
Hello2
</mat-tab>
</mat-tab-group>