Comments (6)
@mightym I did not understand your issue. Could you provide a minimal reproduction? It helps us troubleshoot. A live example would be perfect. This StackBlitz sandbox template may be a good starting point.
from material-ui.
hey @ZeeshanTamboli thanks for your reply!
Well this is less a technical question, more a conceptual question how to handle complex themes in MUI.
I try to rephrase in a single line:
What would you do if 2 different components A & B rely on primary
for the background color in your light theme but on the dark theme the background color for A is still primary
but on B its a slight variation of primary
?
from material-ui.
What would you do if 2 different components A & B rely on
primary
for the background color in your light theme but on the dark theme the background color for A is stillprimary
but on B its a slight variation ofprimary
?
I would use theme.palette.mode
to check for dark mode and apply the slight variation of primary
which you have defined in your custom theme. I really don't understand your issue.
from material-ui.
@ZeeshanTamboli see and thats why you will end up with something extremely complex like in my code example. Because in your approach you will end up with a lot of conditions based on the current theme. What you need is an intermediate level like my theme styles. But for sure you could write conditions in you components.
from material-ui.
What you need is an intermediate level like my theme styles
Okay, so what's the problem with it? What issue is it causing? I see that you are saying the following:
But this has some downsides. Eg. using the color palette properties on components wouldn't reflect my theme anymore. And many others.
But I can't check with a reproduction. It would be better if you can provide a reproduction.
from material-ui.
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.
from material-ui.
Related Issues (20)
- [system] Fix memoTheme() source location
- [code-infra] Clean up bundle size names
- [material-ui] [Stepper] Connecting line issues when label is a long string HOT 3
- [code-infra] Migrate `aws-sdk` to v3 HOT 1
- [Material-UI] [Autocomplete] Issues with clearOnEscape when using screen reader on Windows
- makeStyles uses props, css is invalid HOT 1
- [docs] Popper in Autocomplete demos have higher z-index than the site's nav elements HOT 1
- [material-ui][Skeleton] `animation="wave"` not displaying correctly in MUI v6 HOT 2
- Port classic components to PigmentCSS? HOT 9
- [v6] Skeleton component doesn't work HOT 1
- [material-ui] defaultShouldForwardProp is not a function error in plasmo extension HOT 3
- [useMediaQuery] Result of `useMediaQuery("(max-width: 767px)")` at 767px is `false` on Windows HOT 3
- Switch component is not visible in high contrast mode HOT 6
- Typography component no longer accepts the theme callback after upgrading to v6 HOT 1
- Skeleton component's wave animation misbehaving HOT 2
- CSS Variables Being Overridden After Page Load HOT 2
- MUI v6 with material-pigment-css createSvgIcon compiling error HOT 1
- Pigment CSS Vite example broken HOT 6
- [docs-infra] Remove `https://mui.com/` from API descriptions links
- [docs] IndeterminateIcon is Missing From Checkbox Docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-ui.