Add light/dark mode toggle

This commit is contained in:
2024-01-08 18:06:36 +11:00
parent 941cbca8e8
commit 21131fba6b
6 changed files with 9962 additions and 494 deletions

View File

@@ -4,6 +4,10 @@ import { md_gallery } from "./gallery.js";
(function() {
document.addEventListener("DOMContentLoaded", function () {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
localStorage.setItem("_x_darkMode", event.matches ? true : false)
});
if (window.hljs !== undefined) {
window.hljs.highlightAll();
}