Local Storage

Once you've clicked the 'Dark Mode' link and switched it to 'off', the theme option is saved to local storage. The theme will persist after you refresh the page or close it down and reopen it. Each time you click the button the theme option is saved.

Clearing local storage

During development, you might want to clear local storage to check that the default state is working. To do so:

  • Right-click on the page, then click 'Inspect'.
  • Click on 'Applications'.
  • Right-click on 'DARKMODE-DEFAULT-switcher'.
  • Click 'delete'.
  • Force refresh the page (Control+F5).
  • The default theme will now be restored.

Note: the above instructions are for Chrome on Windows 10. However, most browsers follow a similar pattern.