I noticed when using this template that in certain cases the theme toggle didn't work correctly on the first click because the logic didn't account for when the store default was undefined - the simplest way I found to fix this was to simply determine the current state post-page-load (via useVisibleTask$) by checking whether "dark" was present in the class list.
Happy to make changes if you have any feedback, and thank you for your great work on this template!
I noticed when using this template that in certain cases the theme toggle didn't work correctly on the first click because the logic didn't account for when the store default was
undefined
- the simplest way I found to fix this was to simply determine the current state post-page-load (viauseVisibleTask$
) by checking whether"dark"
was present in the class list.Happy to make changes if you have any feedback, and thank you for your great work on this template!