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
74.16k stars 4.58k forks source link

[bug]: Dark mode theme selector doesn't animate #4883

Open mutewinter opened 1 month ago

mutewinter commented 1 month ago

Describe the bug

Due to disableTransitionOnChange from https://github.com/shadcn-ui/ui/blob/main/apps/www/app/layout.tsx#L93, no dark: animations will function.

This means that the classes in ModeToggle aren't actually doing anything: https://github.com/shadcn-ui/ui/blob/main/apps/www/components/mode-toggle.tsx#L22-L23.

Affected component/components

ModeToggle

How to reproduce

Go to https://ui.shadcn.com/docs/dark-mode/next and change the theme. The icon will not animate.

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

N/A

Before submitting

Lexachoc commented 1 month ago

I also noticed about this and I fixed it. Will make a PR soon.