Jump to content
Eric Roth

Dark Mode & Local Storage

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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...