leerob / leerob.io

✨ My portfolio built with Next.js, Tailwind, and Vercel.

Home Page:https://leerob.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set theme based on user's OS setting

tilda opened this issue · comments

commented

Default should be set using a media query (e.g. prefers-color-scheme: dark). IMO it would be a much better experience to have it set like that (while still having the option to switch themes if wanted).

commented

Hm, it doesn't seem to work for me, at least on Windows with Edge. Tried clearing local storage and it seems to believe my system theme is set to light. (Of course, it isn't.)

If you can repro and find out some more info, might be worth opening an issue on next-themes 🙏 I'm guessing it's related to Edge.

commented

Not sure if it's next-themes, as the live example site on "System" setting does detect my theme correctly... ah well, this might be interesting to look into. Thank you for responding!

Oh, very interesting! Maybe it is me then... strange. Will look more, thank you!