Mui-datatables: How can I change the color of MUIDataTableToolbar icon hover

Created on 5 Oct 2019  路  2Comments  路  Source: gregnb/mui-datatables

Hi
-I want to override this color of toolbar icon as example below:

MUIDataTableToolbar-icon-982:hover {
color: #fd7e14;
}
-I can override the color of icon, but I don't know how to do with hover, please help

const customTheme = createMuiTheme({
overrides: {
MUIDataTableToolbar: {
icon: {
color: "#dc3545"
},

    },
}

});

Thank you.
Lam

question

Most helpful comment

Hi lamthenguyen. It should be as easy as how you'd normally add hover on any react component. Try this:

const customTheme = createMuiTheme({
  overrides: {
      MUIDataTableToolbar: {
        icon: {
           color: "#dc3545",
           '&:hover': {
                color: "HOVERCOLOUR"
            }
        },
    },
  }
});

All 2 comments

Hi lamthenguyen. It should be as easy as how you'd normally add hover on any react component. Try this:

const customTheme = createMuiTheme({
  overrides: {
      MUIDataTableToolbar: {
        icon: {
           color: "#dc3545",
           '&:hover': {
                color: "HOVERCOLOUR"
            }
        },
    },
  }
});

It works OK. Thank you, Yakitrak.

Was this page helpful?
0 / 5 - 0 ratings