Closed michaelkowalski closed 1 year ago
I'm having the same issue
Me too
Hi!
It’s on my radar to fix this but can’t give an ETA for this. Last time I looked into it I didn’t find any obvious bugs that might cause it. If anyone finds the time to also look into this it would be much appreciated :)
a temporary solution is to edit onClick
in colormode-toggle.tsx
and add:
document.documentElement.classList.value = 'theme-ui-' + next;
after setColorMode(next);
Like this:
<button
onClick={() => {
const next = isDark ? `light` : `dark`;
setColorMode(next);
document.documentElement.classList.value = 'theme-ui-' + next;
....
I notice the "/404" page’s toggle is work. I found that this bug occurred because the style tag(<style data-emotion="css-global" data-s="">
) was incorrectly rendered multiple times, which overwrote the current theme.
Doing a proper fix seemed like a rabbit hole so I shipped a simpler fix, thanks @backendrulz for the pointer.
You can update your versions and it should work :)
Description
As in the title. Newly installed site 🥲 Only reloading the page is working. However here on the demo https://minimal-blog.lekoarts.de it works like a charm.
Steps to reproduce
Followed the readme:
Then whatever I do (simple
yarn develop
or publish to hosting) the toggle is just not working.Expected result
Clicking on the toggle we should see dark and light mode after each press
Actual result
Nothing happens unless you reload the site
Environment