insin / gatsby-plugin-dark-mode

A Gatsby plugin which handles some of the details of implementing a dark mode theme
MIT License
68 stars 19 forks source link

Theme toggle requires 2-3 clicks before changing theme #13

Open johndurso opened 3 years ago

johndurso commented 3 years ago

When my site (work in progress) first loads or you hard refresh, the toggle takes 2-3 clicks before changing the theme.

This was occurring out of the box.

https://friendly-jones-0d961e.netlify.app/

luishendrix92 commented 3 years ago

Happens to me as well; the change from light to dark works as intended; toggling the theme from there on after also works as intended.

The problem is when I refresh after setting it to dark, it does load the dark theme and the checkbox does change state, but it takes 3 toggles for it to change to light.

jesielviana commented 3 years ago

I have the same problem, it starts with the dark theme, and to change it to light I have to click 3 times

tiagofragoso commented 3 years ago

I also came across this issue and found that the solution is hidden in the latest commit (83409b53ecdcc5809d75bb11548eec4bfb8acebc). Since this is not part of the latest release, the changes have not made it yet to this plugin's pages in npm or Gatsby docs.

schabibi1 commented 3 years ago

The latest commit solved the issue👍 I had the same issue though it worked perfectly.

zuhairnaqi commented 1 year ago

I also came across this issue and found that the solution is hidden in the latest commit (83409b5). Since this is not part of the latest release, the changes have not made it yet to this plugin's pages in npm or Gatsby docs.

This really helps, Thanks @tiagofragoso