[customization] Working with custom themes & Extend Theme issue #36482
Labels
customization: theme
Centered around the theming features
status: waiting for author
Issue with insufficient information
Duplicates
Latest version
Steps to reproduce 馃暪
@siriwatknp
Link to live example: https://oxygen-sandbox-git-main-rafcin.vercel.app/
Repo: https://github.com/Rafcin/oxygen-sandbox/tree/main
Steps:
pnpm sandbox:build
.pnpm dev
Current behavior 馃槸
I've been confused by the MUI documentation and best practices, and I apologize if any of this is wrong.
So I've been following https://mui.com/material-ui/experimental-api/css-theme-variables/customization/#color-schemes trying to make a component library built on MUI that has a dark and light mode. For the most part, it works, I have a small personal site deployed with it currently, and it works really well! Now when the new 12 MUI release came out on the 6th (https://github.com/mui/material-ui/releases/tag/v5.11.12), I updated the packages, and when I used my site in dev mode, my theme would constantly stay white and use the default theme values. I found out moments ago, when gutting my project and making a minimal reproduction after removing all the important stuff, this issue appeared, and I'm still on version 11. Perhaps this isn't an extended theme issue, or maybe it is; I'm actually really unsure.
Also, this repo contains my little component library I've been working on for a while, I really love MUI and I have an obsession with AirBnB, and this is my attempt at trying to meld the two together. I'm really happy with it, and if you happen to look at the code and see something I should change or improve, let me know, it's not great code, but it's been slowly improving!!!
Edit After writing this, I deployed the app to Vercel, and magically it works on Vercel; I really don't understand the issue now; I have this weird, odd feeling it's Emotion, and Emotion already drives me nuts with the Next 13 issues and all.
Expected behavior 馃
Usually when you switch modes it should go from dark to light or light to dark depending on the system default.,
Context 馃敠
For now, I want to get light and dark themes to work, but my hope with this issue is to raise some more awareness regarding themes and extend MUI components for custom component libraries. It took me a while to make this component library, and I hope to turn this into a component library that has a set of themes people can use and components that are helpful that MUI doesn't offer out of the box. It would be nice to see the theme system be more flexible and work with theme types to be more accessible.
Your environment 馃寧
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: