Jump to content

Dark Mode & Local Storage


Eric Roth

Recommended Posts

Hello,

Is there a way to combine dark mode (https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp) and local storage (https://www.w3schools.com/html/html5_webstorage.asp)? I managed to implement the dark mode function but fail to combine that with local storage, e.g. the user toggles to the dark mode and this stays even when refreshing the page or browsing to another within the same domain. You can see the dark mode function on my website here: https://ericroth.org/

Any help much appreciated, thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...