"use strict" const THEME_KEY = "used-theme"; function updateTheme() { let theme = localStorage.getItem(THEME_KEY); if (theme != null) { document.documentElement.setAttribute(THEME_KEY, theme) } } function setTheme(theme) { localStorage.setItem(THEME_KEY, theme); updateTheme(); } updateTheme();