mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

Can't apply Theme in Material > v4.0.0 when mui-datatables is present

Open larissa-n opened this issue 6 years ago • 7 comments

I feel bad for opening another issue with 203 open right now, but I have to at least mention it in case anybody else runs into this problem:

Theming and styles in Material UI in version 4 and onwards will not be applied if mui-datatables is present. Other Material UI features work (and I see that some work has happened vis-a-vis Material UI v4: https://github.com/gregnb/mui-datatables/issues/886), but <ThemeProvider theme={theme}> will be ignored unless mui-datatables is disabled.

larissa-n avatar Sep 11 '19 20:09 larissa-n

Haha, no worries @larissa-n, issues are issues! I do need to clean a bunch of the out as there are a lot of old ones out there that I think are no longer relevant.

What do you mean by "mui-datatables is disabled?" Are you saying that any project using mui v4 and this library will prevent any styling from working anywhere, even outside of the library?

If so, can you provide an example of the breakage in a codesandbox so I can take a look?

gabrielliwerant avatar Sep 11 '19 21:09 gabrielliwerant

Hi, I do also have strange behavior with MUI theme in the table. e.g. when simply using the table (copied from the example) I get a white font on a white background for the header. The background should be black. That's at least how my appbar look like, white on black. However when I put the MuiThemeProvider again directly around the table setting the same theme, the table header font color is black. No, I don't set any special font colors in-between.

hbinkle avatar Oct 25 '19 06:10 hbinkle

Can you post a simple example to codesandbox @hbinkle?

gabrielliwerant avatar Oct 25 '19 18:10 gabrielliwerant

Hi, with further investigation I found that the style "MUIDataTableHeadRow" overrides "MuiTableHead". "MUIDataTableHeadRow" can't be set any longer for MUIv4.x. How can I set "MUIDataTableHeadRow" in an typescript enviroment to get the correct background color?

hbinkle avatar Nov 05 '19 13:11 hbinkle

I am having the same issue. My appbar is normally blue, but turns white on white background when Muidatatable is present.

kyesildagli avatar Oct 25 '21 10:10 kyesildagli

Can confirm, muidatatables blocks dark mode for the entire webpage.

bentheiii avatar Mar 29 '22 06:03 bentheiii

Also seeing issues where the stylings implemented through MUI of all components on the same page as the MUIDataTable are lost. Any movement on this issue @gabrielliwerant ?

BinarySteve avatar Apr 03 '22 04:04 BinarySteve