Files
rengine/static/assets/js/theme-switcher.js
T
2021-08-10 21:29:49 -05:00

15 lines
421 B
JavaScript

function changeTheme(){
const theme_switch = document.getElementById("theme-switch");
if (theme_switch.checked) {
DarkReader.setFetchMethod(window.fetch);
DarkReader.enable();
// Add the ff. line to write to memory.
localStorage.setItem("my-theme","dark");
}
else {
DarkReader.disable();
// Add the ff. line to write to memory.
localStorage.setItem("my-theme",null);
}
}