theme-change
theme-change copied to clipboard
Calling themeChange doesn't change the theme
The toggle component works fine but after a user login, I can't set the theme because changing the value(what I update from a store) only changes the toggle's state:
<input type="checkbox" class="toggle toggle-primary"
data-toggle-theme="light,dark" data-theme="dark"
bind:checked={isDarkMode} on:change={handleModeUpdate} />
</label>
In this case, the site will be still dark when a different component changes isDarkMode to false when it was true by default.
The toggle doesn't even react to the update of isDarkMode at all. I was wondering if I should try a select but if there is no mechanism to update the theme then there is no point in it.
Can you please provide an example repo?