diff options
Diffstat (limited to 'static/theme_button.js')
| -rw-r--r-- | static/theme_button.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/static/theme_button.js b/static/theme_button.js new file mode 100644 index 0000000..d71c4fb --- /dev/null +++ b/static/theme_button.js @@ -0,0 +1,5 @@ +// Set lightmode +document.getElementById('mode').addEventListener('click', () => { + document.documentElement.classList.toggle('light'); + localStorage.setItem('theme', document.documentElement.classList.contains('light') ? 'light' : 'dark'); +}); |
