shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
71.53k stars 4.31k forks source link

[bug]: Dark Mode doesn't work with CSS Variables set to false #3503

Open sadnansami opened 5 months ago

sadnansami commented 5 months ago

Describe the bug

Before I begin, I would like to apologize if I get anything wrong because it's my second ever Github Issue submission. Basically, I'm using Astro.js and I followed the installation guide to install shadcn/ui and also followed the guide for how to add a dark-mode switch button. I analysed my code and the code provided by shadcn/ui and it turned out that the "dark" class was being applied to my tag properly and the components had "dark:" tags as well but they wouldn't have any effect. I tried reinstalling shadcn multiple times, freshly creating new astro projects and trying to get it to work on a new, simple astro project (which kind of applied dark mode on some elements but not properly). It turns out the issue was with CSS variables. Once I re-initialize shadcn and set CSS variables to True, it works again.

Affected component/components

All

How to reproduce

N/A

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

N/A

Before submitting

Paavni-Goyal commented 4 months ago

Hey @sadnansami I can fix this bug. Can you assign me the same.

sadnansami commented 4 months ago

Apologies, I am new to using Github to post issues so I'm not sure what you're referring to.