question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 TextFields’ 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:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jaredroopraicommented, May 15, 2020

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

1reaction
oliviertassinaricommented, Mar 31, 2021

@bennidhamma The change of button color comes from the removal of color="default" for color="primary" as a default. See #18776

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dark mode not applying to textfield or buttons #21040 - GitHub
I set the theme to dark mode using the createMuiTheme as stated in the documentation and provided it with a ThemeProvider . However,...
Read more >
How should I indicate that a button or input is disabled in a ...
A dark theme showing buttons in various states ... This uncertainty and unpredictability is not an optimal user experience.
Read more >
Theme dark turns textfield to white - Stack Overflow
when I try to use the dark theme, it turns the text field to white instead of a gray background. Am I doing...
Read more >
clearbuttonmode on dark mode | Apple Developer Forums
I was working with dark mode settings and stuck on one problem. ... For some reason, the clear button is not visible in...
Read more >
Dark Mode for HTML Form Controls - Microsoft Edge Blog
With dark mode enabled on the system, no changes were applied to the contents in the “Default style area” box. Within the “Schemed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found