Dark mode not applying to textfield or buttons
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
I set the theme to dark mode using the createMuiTheme
as stated in the documentation and provided it with a ThemeProvider
. However, when I put in TextField
or Button
into my application, I get the same accent colors as the original light mode.
Expected Behavior 🤔
I expect the palette colors to change to match the colors on the Material UI page such as here or here.
Steps to Reproduce 🕹
Here’s a code sandbox showing what I mean.
https://codesandbox.io/s/material-demo-pb53w
The colors on the TextFields are dark blue and don’t contrast at all with the Paper
behind them. Since the Paper
color changed, I would expect the TextField
s’ outlines to change as well.
Context 🔦
I’m trying to use the dark mode since I think it better suits my use case, and I thought that the dark mode would be automatically applied to all the components.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.14 |
React | v16.13.1 |
Browser | Chrome 81.0.4044.138 |
TypeScript | 3.9.2 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Hey, on this page you can see what object properties dark mode changes: https://material-ui.com/customization/palette/#dark-mode
It doesn’t change the
palette.primary
property which is where that blue colour is coming from, you can do so like this : https://codesandbox.io/s/material-demo-zr11m?file=/index.js@bennidhamma The change of button color comes from the removal of
color="default"
forcolor="primary"
as a default. See #18776