New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing theme does not change background color when using CSS variables #34911
Comments
You should add import CssBaseline from '@mui/material/CssBaseline';
<CssVarsProvider>
<CssBaseline />
...
</CssVarsProvider> I think this deserves some documentation after #34639 is implemented. |
import from '@mui/material/styles' was giving me |
Can you assign this issue to me ? |
馃憤Yes, you are right! changed to the correct import. |
a good solution to this for anyone encountering the same problem is Not to create the theme on the fly here's an example :
what would you do instead:
I hope this would be helpful as I faced this problem and resolved it this way |
Duplicates
Latest version
Steps to reproduce 馃暪
Live example links
https://codesandbox.io/s/create-react-app-with-typescript-forked-46llm7?file=/src/index.tsx
https://nikhil1920.github.io/next-js-mui-pwa-starter/
Current behavior 馃槸
Background color is not changing based on theme
Expected behavior 馃
Background color should change based on current theme
Context 馃敠
No response
Your environment 馃寧
No response
The text was updated successfully, but these errors were encountered: