在选择时更改选项卡文本颜色
问题描述:
我正在研究 Angular4,并且一直在使用有角材料.我创建了一个选项卡组,我想在选择任何选项卡时更改选项卡标签的文本颜色.我试图覆盖默认的 css,但这对我没有帮助.
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;
} */
我试图改变 tab-label-color 颜色的评论部分.
The commented part which I was trying to change the color of a tab-label-color.
答
您需要为活动选项卡使用以下类:
You need to use the following class for active tab:
.mat-tab-label-active {
color: #00ADEE !important;
}
这是工作演示的链接.