Skip to content

Commit 9af0ff6

Browse files
committed
Updates
1 parent 154e712 commit 9af0ff6

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

‎index.html‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎js/initial-background.js‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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")&&!state.get.current()){
4-
console.log("hit");
5-
if(window.matchMedia("(prefers-color-scheme:light)").matches){
6-
if(nightTabData){
7-
if(nightTabData.state.theme.style=="dark"){
8-
document.querySelector("html").setAttribute("style","background-color: rgb(0, 0, 0)");
9-
};
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)");
107
};
11-
}elseif(window.matchMedia("(prefers-color-scheme:dark)").matches){
12-
if(nightTabData){
13-
if(nightTabData.state.theme.style=="light"){
14-
document.querySelector("html").setAttribute("style","background-color: rgb(255, 255, 255)");
15-
};
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)");
1613
};
1714
};
1815
};

0 commit comments

Comments
(0)