konstaui / konsta

Mobile UI components made with Tailwind CSS
https://konstaui.com
MIT License
3.52k stars 131 forks source link

React dark mode does not work #120

Closed hiyelbaz closed 1 year ago

hiyelbaz commented 1 year ago

Check that this is really a bug

Reproduction link

https://stackblitz.com/edit/konsta-react-ry2c45?file=App.jsx

Bug description

"dark" prop of the or does not change the theme <App theme={theme} dark={true}>

Expected Behavior

No response

Actual Behavior

No response

Konsta UI version

1.0.2

Platform/Target and Browser Versions

any

Validations

Would you like to open a PR for this bug?

typytypytypy commented 1 year ago

Any updates on this? I currently have to set a "dark" class on the html element.

nephix commented 1 year ago

This is how it works in tailwindcss if you set darkMode: 'class'

As for the original issue dark according to the docs only generates dark: class names, it doesn't toggle dark mode.

If you want to toggle dark mode, check the official Tailwind docs on Toggling dark mode manually