Coder Social home page Coder Social logo

Comments (6)

ZeeshanTamboli avatar ZeeshanTamboli commented on August 29, 2024

@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.

mightym avatar mightym commented on August 29, 2024

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.

ZeeshanTamboli avatar ZeeshanTamboli commented on August 29, 2024

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?

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.

mightym avatar mightym commented on August 29, 2024

@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.

ZeeshanTamboli avatar ZeeshanTamboli commented on August 29, 2024

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.

github-actions avatar github-actions commented on August 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.