Store themes on cookies #11577
Unanswered
washington299
asked this question in
Help
Replies: 1 comment 2 replies
-
I Coded the dark mode switch in JS and basic CSS. My version does store the color preference in localStorage of the browser, for the speed. Cookies are server-side. In localStorage we can have settings without logins or user profiles. In my version the multiple color themes can be defined inside of one CSS style file. Many color theme in one file :-) Try it on the Github demo page : Feel free to fork, copy, adopt, etc... Have fun ! 👍 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can someone tell me how to switch light mode and dark mode themes with styled-components and persist it on cookies, I’m trying to do this for my portfolio but it’s not working, and I can’t fix it, It would be great an example like this inside the examples folder.
Beta Was this translation helpful? Give feedback.
All reactions