theme-change icon indicating copy to clipboard operation
theme-change copied to clipboard

Calling themeChange doesn't change the theme

Open ghost opened this issue 2 years ago • 2 comments

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.

ghost avatar Apr 15 '23 15:04 ghost

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.

ghost avatar Apr 15 '23 15:04 ghost

Can you please provide an example repo?

saadeghi avatar Apr 20 '23 01:04 saadeghi