Closed indcoder closed 9 months ago
Thank you @indcoder
for reporting issues. It helps daisyUI a lot ๐
I'll be working on issues one by one. I will help with this one as soon as a I
find a solution.
In the meantime providing more details and reproduction links would be
helpful.
Unchecked checkbox with theme-controller
class does nothing.
Checked checkbox with theme-controller
class applies the theme specified in value.
So theme-controller
does not care about your system theme, and yes as you said, if the system theme is dark
, it switches dark to dark.
This is not a bug. It's how it's expected to work logically if you think about it.
To overcome that, you can disable system dark mode using darkTheme: false
config. This way, the unchecked checkbox will be light and checked will be dark.
Another thing you can do use radio inputs:
https://daisyui.com/components/theme-controller/#theme-controller-using-a-radio-input
Because a checkbox can only have 2 values. With radio buttons you can have 3 values or more (system / light / dark)
Let me know if you have a question.
What version of daisyUI are you using?
4.6.0
Which browsers are you seeing the problem on?
Chrome, Edge
Reproduction URL
https://daisyui.com/components/theme-controller/
Describe your issue
We are using the theme controller to control between the light and dark theme
I noticed while the theme controller works as expected if the system/browser is in light mode. But if its not, the theme controller does not default to the dark mode.
Also when I change the value to dark when the browser is in dark mode by default the
I see the checked bool and value getting triggered.
But when I reverse the toggle back to light, it still remains dark even though css values seem to suggest the light theme needs to be in effect. Also tried with updating checkbox value to "light"