Minor
This commit is contained in:
parent
34f9485c99
commit
e0b1d3dbaa
@ -355,4 +355,10 @@ footer a {
|
|||||||
/* font-family: "Monaspace"; */
|
/* font-family: "Monaspace"; */
|
||||||
font-size: small;
|
font-size: small;
|
||||||
margin-bottom: calc(-0.5 * var(--h1-margin-top));
|
margin-bottom: calc(-0.5 * var(--h1-margin-top));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Comments */
|
||||||
|
|
||||||
|
.giscus {
|
||||||
|
margin-top: 3rem;
|
||||||
}
|
}
|
@ -41,28 +41,22 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console
|
|
||||||
document.body.classList.remove("auto");
|
document.body.classList.remove("auto");
|
||||||
let cls = "light";
|
let cls = "light";
|
||||||
|
|
||||||
console.log
|
|
||||||
|
|
||||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
cls = "dark";
|
cls = "dark";
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.classList.add(cls);
|
document.body.classList.add(cls);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function invert() {
|
function invertBody() {
|
||||||
document.body.classList.toggle("dark");
|
document.body.classList.toggle("dark");
|
||||||
document.body.classList.toggle("light");
|
document.body.classList.toggle("light");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAuto()) {
|
if (isAuto()) {
|
||||||
console.log("Setting invert listener");
|
window.matchMedia('(prefers-color-scheme: dark)').addListener(invertBody);
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addListener(invert);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setTheme();
|
setTheme();
|
||||||
|
Loading…
Reference in New Issue
Block a user