Skip to content

Commit f4135d3

Browse files
grischeclaude
authored andcommitted
theme: rename theme_night class to theme_dark
Align the CSS class name with the public-facing terminology introduced earlier in this branch (light / dark / auto). The DARK_CLASS constant in lib/theme.ts and the inline pre-paint script in index.html now use "dark"; scss/night.scss is renamed to scss/dark.scss for symmetry. No behavior change. The class is set only by lib/theme.ts and the pre-paint script; nothing else consumed the old name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8044485 commit f4135d3

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
<link rel="mask-icon" href="./mask-icon.svg" color="#FFFFFF" />
3131
<meta name="theme-color" content="#ffffff" />
3232

33-
<!-- Keep storage key ("meshviewer.theme") and class name ("theme_night") in sync with lib/theme.ts -->
33+
<!-- Keep storage key ("meshviewer.theme") and class name ("theme_dark") in sync with lib/theme.ts -->
3434
<script>
3535
try {
3636
var t = localStorage.getItem("meshviewer.theme");
3737
if (t === "dark" || (t !== "light" && matchMedia("(prefers-color-scheme: dark)").matches)) {
38-
document.documentElement.classList.add("theme_night");
38+
document.documentElement.classList.add("theme_dark");
3939
}
4040
} catch (e) {
4141
try {
4242
if (matchMedia("(prefers-color-scheme: dark)").matches) {
43-
document.documentElement.classList.add("theme_night");
43+
document.documentElement.classList.add("theme_dark");
4444
}
4545
} catch (_) {
4646
/* matchMedia unavailable; accept a light paint */

lib/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type Theme = "light" | "dark" | "auto";
22

33
// Keep STORAGE_KEY and DARK_CLASS in sync with the pre-paint inline script in index.html.
44
const STORAGE_KEY = "meshviewer.theme";
5-
const DARK_CLASS = "theme_night";
5+
const DARK_CLASS = "theme_dark";
66
const THEMES: Theme[] = ["light", "dark", "auto"];
77

88
let inMemory: Theme = "auto";

scss/night.scss renamed to scss/dark.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ variables.$color-map-background: #0d151c;
1010

1111
variables.$color-online: color.adjust(variables.$color-online, $lightness: 25%);
1212

13-
.theme_night {
13+
.theme_dark {
1414
//@import 'modules/base';
1515
body,
1616
textarea,

scss/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727

2828
// Make adjustments in custom scss
2929
@use "custom/custom";
30-
@use "night";
30+
@use "dark";

0 commit comments

Comments
 (0)