Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling themeChange doesn't change the theme #37

Open
ghost opened this issue Apr 15, 2023 · 2 comments
Open

Calling themeChange doesn't change the theme #37

ghost opened this issue Apr 15, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 15, 2023

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
Copy link
Author

ghost commented Apr 15, 2023

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.

@saadeghi
Copy link
Owner

Can you please provide an example repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant