1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 17:05:32 -04:00

update deps

This commit is contained in:
2020-04-21 11:51:39 -04:00
parent 4d22a28435
commit 7de9d10792
3 changed files with 45 additions and 38 deletions

View File

@@ -14,19 +14,14 @@ let pref = localStorage.getItem('dark_mode_pref');
const isSystemDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
const isSystemLight = window.matchMedia("(prefers-color-scheme: light)").matches;
// keep track of current state, no matter how we get there...
let currentlyDark = false;
const activateDarkMode = function() {
document.body.classList.remove('light');
document.body.classList.add('dark');
currentlyDark = true;
};
const activateLightMode = function() {
document.body.classList.remove('dark');
document.body.classList.add('light');
currentlyDark = false;
};
// if user already explicitly enabled dark mode in the past, turn it back on.