Add 2026-dark theme and set as default
This commit is contained in:
parent
88bc0d1a2b
commit
9eea6550ad
5 changed files with 652 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue