Skip to content

Commit b1249b2

Browse files
committed
Updates
1 parent cbab00f commit b1249b2

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

‎js/initial-background.js‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// inital check for systems which do not have light or dark mode
22
varnightTabData=JSON.parse(localStorage.getItem("nightTab"));
3-
if(!document.querySelector("html").classList.contains("is-ready")){
4-
if(window.matchMedia("(prefers-color-scheme:light)").matches){
5-
if(nightTabData){
6-
if(nightTabData.state.theme.style=="dark"){
7-
document.querySelector("html").setAttribute("style","background-color: rgb(0, 0, 0)");
8-
};
3+
if(window.matchMedia("(prefers-color-scheme:light)").matches){
4+
if(nightTabData){
5+
if(nightTabData.state.theme.style=="dark"){
6+
document.querySelector("html").setAttribute("style","background-color: rgb(0, 0, 0)");
97
};
10-
}elseif(window.matchMedia("(prefers-color-scheme:dark)").matches){
11-
if(nightTabData){
12-
if(nightTabData.state.theme.style=="light"){
13-
document.querySelector("html").setAttribute("style","background-color: rgb(255, 255, 255)");
14-
};
8+
};
9+
}elseif(window.matchMedia("(prefers-color-scheme:dark)").matches){
10+
if(nightTabData){
11+
if(nightTabData.state.theme.style=="light"){
12+
document.querySelector("html").setAttribute("style","background-color: rgb(255, 255, 255)");
1513
};
1614
};
1715
};

0 commit comments

Comments
(0)