Reduce flickering with dark/light theme (#1241)
This commit is contained in:

committed by
nitrohorse

parent
0276f52ed2
commit
24412dcf8f
6
assets/js/applytheme.js
Normal file
6
assets/js/applytheme.js
Normal file
@ -0,0 +1,6 @@
|
||||
if (localStorage.getItem("colorScheme") === "dark") {
|
||||
document.querySelector("#dark-css").removeAttribute("media"); // Set dark theme
|
||||
}
|
||||
else if (localStorage.getItem("colorScheme") === "light") {
|
||||
document.querySelector("#dark-css").setAttribute("media", "invalid"); // Set light theme
|
||||
}
|
Reference in New Issue
Block a user