Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
Former-commit-id: e0b1d3d
  • Loading branch information
tomfran committed May 11, 2024
1 parent 7e992e9 commit 5f815a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,10 @@ footer a {
/* font-family: "Monaspace"; */
font-size: small;
margin-bottom: calc(-0.5 * var(--h1-margin-top));
}

/* Comments */

.giscus {
margin-top: 3rem;
}
10 changes: 2 additions & 8 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,22 @@
return
}

console
document.body.classList.remove("auto");
let cls = "light";

console.log

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
cls = "dark";
}

document.body.classList.add(cls);

}

function invert() {
function invertBody() {
document.body.classList.toggle("dark");
document.body.classList.toggle("light");
}

if (isAuto()) {
console.log("Setting invert listener");
window.matchMedia('(prefers-color-scheme: dark)').addListener(invert);
window.matchMedia('(prefers-color-scheme: dark)').addListener(invertBody);
}

setTheme();
Expand Down

0 comments on commit 5f815a8

Please sign in to comment.