Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing tab text color on selection

I am working on Angular4 and have been using angular material. I have created a tab-group and I want to change the text color of a tab label when I select any tab. I have tried to override the default css but that didn't help me.

I can override the ink bar but I am not able to override tab-text color upon selection

.mat-ink-bar{
    background-color:#00ADEE;
}
 /*.mat-tab-label::selection{
 color: #00ADEE !important;
 } */

The commented part which I was trying to change the color of a tab-label-color.

like image 815
nethra gowda Avatar asked Jan 25 '26 22:01

nethra gowda


1 Answers

You need to use the following class for active tab:

.mat-tab-label-active {
     color: #00ADEE !important;
 } 

Here is a link to working demo.

like image 60
Faisal Avatar answered Jan 28 '26 17:01

Faisal