Angular 2 material tab active color customize

11,698

Solution 1

Try to it's work for me

::ng-deep .mat-ink-bar {
  background-color:#ee2925 !important;}

Solution 2

It's worked for me in Angular 6

.mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar {
    background-color: #1f29a2;
}

Solution 3

Works in Angular 7

.mat-tab-group.mat-primary .mat-ink-bar,.mat-tab-nav-bar.mat-primary .mat-ink-bar {
    background-color: #2C702A;
}
Share:
11,698
Harikrishnan KayKay
Author by

Harikrishnan KayKay

A passionate & enthusiastic self taught web developer who likes learning new technologies & frameworks, getting the nails and teeth deep down to pull out the nuts and bolts of each one of them and dissect them to gain more expertise on it. Started in another technology, but ended up in web development by personal choice and interest, HTML5, CSS3, JQuery & Responsive web development is the keen area of expertise along with angular JS. Recently, dipped my feet into Knockout JS as well.

Updated on June 04, 2022

Comments

  • Harikrishnan KayKay
    Harikrishnan KayKay almost 2 years

    I was looking to customize the active color for md-tab. enter image description here

    The classes in chrome dev console shows ==> -mat-tab-label mat-ripple mat-tab-label-active. But none has any border bottom. There was a chevron class which i tried to change, but no effect.

    I tried /deep/ with almost all classes. Dint work. Also checked md-tab-header, but nowhere am seeing even that color! Any help would be appreciated :)