Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change the color of tab text and the underline in materialize framework

The default color of materialize tabs are pinkish. Also the underline for the active tab. I want to customize that and add some styles. How do I do that?

like image 457
Kruthika C S Avatar asked Dec 31 '16 08:12

Kruthika C S


2 Answers

Images: Active tab and Tab2 on hover

Code changes in CSS for the effects in above 2 images :

        .tabs .tab a{
            color:#000;
        } /*Black color to the text*/

        .tabs .tab a:hover {
            background-color:#eee;
            color:#000;
        } /*Text color on hover*/

        .tabs .tab a.active {
            background-color:#888;
            color:#000;
        } /*Background and text color when a tab is active*/

        .tabs .indicator {
            background-color:#000;
        } /*Color of underline*/
like image 196
Kruthika C S Avatar answered Nov 08 '22 03:11

Kruthika C S


The best way to add custom CSS to Materialize 1.0.0 default tabs is the following:

.tabs .tab a {
  color: rgba(38, 166, 154, 0.7);
  /*Custom Text Color*/
}

.tabs .tab a:hover {
  color:#26a69a;
  /*Custom Color On Hover*/
}

.tabs .tab a:focus.active {
  color:#26a69a;
  /*Custom Text Color While Active*/
  background-color: rgba(38, 166, 154, 0.2);
  /*Custom Background Color While Active*/
}

.tabs .indicator {
  background-color:#26a69a;
  /*Custom Color Of Indicator*/
}

*If you want to keep the default styling of the framework, use the RGBA values as they are in the example.

like image 9
Emmanouil Kafieris Avatar answered Nov 08 '22 03:11

Emmanouil Kafieris