mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2025-06-11 00:03:02 -04:00
Reduce flickering with dark/light theme (#1241)
This commit is contained in:
parent
0276f52ed2
commit
24412dcf8f
4 changed files with 28 additions and 20 deletions
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue