Comments (15)
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.
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.
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.
I got the same problem, any update ?
from nextjs-starter-medusa.
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.
@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.
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.
@VariableVic For me Safari and Chrome still got that same problem.
from nextjs-starter-medusa.
@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.
For me this issue happened when I updated tailwind above 3.3.3 as the issue description says
from nextjs-starter-medusa.
@ericwaetke great catch, I'd happily accept that PR!
from nextjs-starter-medusa.
I don't think you understand the problem. We need to darkMode and it is simply not working.
from nextjs-starter-medusa.
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.
@VariableVic just look the original post pictures with darkmode the whole store is unusable
from nextjs-starter-medusa.
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:
- Implement @ericwaetke's fix to prevent the store from switching to dark mode entirely. This will enforce light mode regardless of the user settings.
- 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.
@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)
- checkout breaks when Paystack is the only payment provider HOT 1
- App won't build with yarn build HOT 3
- Slow API fetch, both in dev and prod HOT 5
- Unsecured Cookie Allows Unauthorized Access to Discounts and Shipping Address in This Template HOT 1
- bug: Click to log out, unable to login again
- Installation error on latest macOS (number-float64-base-normalize)
- Error: A "use server" file can only export async functions. HOT 4
- Javascript HOT 1
- SyntaxError: Unexpected token < in JSON at position 0 HOT 4
- MeiliSearch Instantsearch RefinementList is not working HOT 1
- Medusa client or Nextjs caching bearer token between requests to backend for different user sessions HOT 1
- Refreshing on account pages and then logging out redirects to a 404 and not the login page
- Fix modal overflow on small viewports
- Menu overflow on small viewports
- Paypal Live Mode does not work HOT 10
- Forgot/Reset Password HOT 2
- Cannot finish checkout process when a user applies a giftcard HOT 2
- TypeError: fetch failed src\middleware.ts (21:30) @ fetch HOT 1
- How to change stripe element to more payment methods?
- https://docs.medusajs.com/recipes/b2b no longer works server/client side HOT 2
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 nextjs-starter-medusa.