Ibra
Ibra

Reputation: 1072

I'm using MUI-Data-Tables and I would like to change the header text color after I click to sort the Column?

I need to override the default black text color when sorting a column, I'm not sure how to do it. The closest I got was to change the arrow icon color using the snippet below.

 MUIDataTableHeadCell: {
        sortAction: {
            '& path': {
              color: "teal " // or whatever you need
            }, 
            }, 
      }, 

Does anyone have an idea how can I change the text color too? :)

Upvotes: 0

Views: 2957

Answers (1)

Rakez
Rakez

Reputation: 26

This should do the trick!

 MUIDataTableHeadCell: {
    sortAction: {
        '& path': {
          color: "teal " // or whatever you need
        }, 
     }, 
    sortActive: {
      color: ""  // whatever you need
    }
  }, 

sortActive = Header Text Color

Upvotes: 1

Related Questions