Add 2026-dark theme and set as default

This commit is contained in:
Martin Dvořák 2026-10-22 23:22:05 +00:00
commit 9eea6550ad
5 changed files with 652 additions and 12 deletions

View file

@ -69,8 +69,8 @@
(function () {
"use strict";
var LIGHT = "aurora-light";
var DARK = "aurora-dark";
var KEY = "dxd-theme";
var DARK = "2026-dark";
var KEY = "dxd-theme-2026";
function themeLink() {
return document.querySelector('link[rel="stylesheet"][href*="/css/theme-"]');
@ -87,12 +87,13 @@
function mode() {
var link = themeLink();
if (!link) return "light";
if (!link) return "dark";
return /-light\.css/.test(link.getAttribute("href")) ? "light" : "dark";
}
/* Apply the saved preference before the page paints, so there is no flash. */
try {
localStorage.removeItem("dxd-theme");
var saved = localStorage.getItem(KEY);
if (saved === "dark") apply(DARK);
else if (saved === "light") apply(LIGHT);