Git Product home page Git Product logo

Comments (15)

ericwaetke avatar ericwaetke commented on June 15, 2024 3

I’ve got the same problem even with 2.4.1.
And I also don’t think it’s any dark: leftovers, as there are no dark: classes in the code.

However, there is a layout.css file being generated, that sets the color variables based on the css prefers-color-scheme: dark setting.

Bildschirmfoto 2024-02-26 um 15 34 24

It’s because the ui-preset tailwind plugin is looking at the config to see, if the darkMode: 'class' property is set in the tailwind.config.js. If not (as it is by default), it overrides the color variables based on the system color scheme.

So you can fix it by explicitly saying the dark-mode isn’t set based on the system:

module.exports = {
  darkMode: 'class',
  presets: [require("@medusajs/ui-preset")],}

I could also create a PR to make this the default behaviour for freshly created nextjs-starters, if that’s wanted

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024 1

It's not a priority as of now, but we might add it later. Feel free to add it as an idea to GH discussions!

from nextjs-starter-medusa.

fuse-thanakorn avatar fuse-thanakorn commented on June 15, 2024

I got the same problem, any update ?

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024

Hey guys @xyzones @fuse-thanakorn,

I think there was a bug in Medusa UI that caused some dark mode issues. Should be solved in later versions. Could you try updating Medusa UI to >2.4.1?
"@medusajs/ui": "^2.4.1"

from nextjs-starter-medusa.

xyzones avatar xyzones commented on June 15, 2024

@VariableVic the dark:... is missing from lot of places. so I don't think was only a @medusajs/ui issue

I have update the package and it is still not working.

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024

The Starter doesn't support dark mode, so any dark: classes present are leftovers from an early version.

I can't replicate the issue with the package versions you mentioned. What browser are you using?

from nextjs-starter-medusa.

fuse-thanakorn avatar fuse-thanakorn commented on June 15, 2024

@VariableVic For me Safari and Chrome still got that same problem.

from nextjs-starter-medusa.

xyzones avatar xyzones commented on June 15, 2024

@VariableVic this is what we say that due to some leftover or bugs the design breaks in dark mode. Safari, chrome same issue

from nextjs-starter-medusa.

Bernix01 avatar Bernix01 commented on June 15, 2024

For me this issue happened when I updated tailwind above 3.3.3 as the issue description says

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024

@ericwaetke great catch, I'd happily accept that PR!

from nextjs-starter-medusa.

xyzones avatar xyzones commented on June 15, 2024

I don't think you understand the problem. We need to darkMode and it is simply not working.

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024

We need to darkMode and it is simply not working.

What do you mean exactly? Are you trying to add dark: classes and they aren't picking up? Please elaborate on what you're trying to achieve and what is not working as expected.

from nextjs-starter-medusa.

xyzones avatar xyzones commented on June 15, 2024

@VariableVic just look the original post pictures with darkmode the whole store is unusable

from nextjs-starter-medusa.

VariableVic avatar VariableVic commented on June 15, 2024

Like I said, this Starter doesn't support dark mode out of the box. It's light mode only. There's 2 things you can do here:

  1. Implement @ericwaetke's fix to prevent the store from switching to dark mode entirely. This will enforce light mode regardless of the user settings.
  2. Or, if you want to use dark mode: implement it yourself. You can use Medusa UI classes like bg-ui-bg-base - they will switch based on the user system setting. As you can see in your screenshot, some components are already using these, and thus reacting to dark mode.

from nextjs-starter-medusa.

xyzones avatar xyzones commented on June 15, 2024

@VariableVic so no intention to make this available? I have solved this went I opened, so is not really affecting me, however this would be surely much appreciated by the community ;)

from nextjs-starter-medusa.

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.