From 87e74ca90d4c13758461f380b00ed83b5a287da9 Mon Sep 17 00:00:00 2001 From: marudor Date: Thu, 16 May 2019 15:22:47 +0200 Subject: Add color switcher to toolbar --- public/static/js/theme.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 public/static/js/theme.min.js (limited to 'public/static/js/theme.min.js') diff --git a/public/static/js/theme.min.js b/public/static/js/theme.min.js new file mode 100644 index 0000000..975a76e --- /dev/null +++ b/public/static/js/theme.min.js @@ -0,0 +1 @@ +var validThemes=["dark.min","light.min"],currentTheme=localStorage.getItem("theme");function toggleTheme(){currentTheme="dark.min"===currentTheme?"light.min":"dark.min",localStorage.setItem("theme",currentTheme),addStyleSheet(currentTheme,"theme")}validThemes.includes(currentTheme)||(currentTheme=window.matchMedia("(prefers-color-scheme: dark").matches?"dark.min":"light.min"),addStyleSheet(currentTheme,"theme"); -- cgit v1.2.3