Kit: light/dark switch in the shared header - #59
Merged
Merged
Conversation
…mm sites The kit already followed the system setting. Add a moon/sun switch to the header tools that sets data-theme on <html> and keeps the choice in a cookie on interimm.org (shared with its project pages and subdomains). Dark tokens now apply under the system setting unless light is picked, or when dark is picked. InterImm.theme and the interimm:theme event let page scripts follow it. City plans are inverted in dark so they read as white ink on the dark page. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GXRSGzjJ5y9c6kGHNoH6uD
This was referenced Oct 4, 2026
emptymalei
marked this pull request as ready for review
October 4, 2026 03:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by L · project thread
Before: every InterImm site already turned dark when the visitor's system was set to dark, but there was no way to choose.
After: the shared header has a moon/sun switch next to GitHub and the language link. The choice is remembered in a cookie on
interimm.org, so it carries across interimm.org, its project pages (/interplanetary-logistics/, /mars-map/, /mars-open-facilities/) and its subdomains (cities.interimm.org, book.interimm.org). Picking the theme the system already uses clears the choice, so the page follows the system again.How: the kit's dark tokens now apply under
prefers-color-scheme: darkunlessdata-theme="light"is on<html>, and always underdata-theme="dark". interimm.js adds the switch to.nav-tools(or wires any[data-theme-toggle]button), setsdata-theme-now, updates the browser bar colour, and exposesInterImm.themeplus aninterimm:themeevent for scripts that draw in colour.head.htmlapplies a saved choice before first paint. The city plan image map is inverted in dark so it reads as white ink.kit/README.mddocuments the pattern for site styles. Additive: no class or token was renamed.Companion PRs make the sister sites' own dark colours follow the switch: interplanetary-logistics, martian-cities, mars-map, mars-open-facilities (all branch
claude/project-thread-yusfly).Previews (local Hugo 0.135.0 build): project files
dark-mode/(home, phone menu, city plan, and each sister site).🤖 Generated with Claude Code
https://claude.ai/code/session_01GXRSGzjJ5y9c6kGHNoH6uD
Generated by Claude Code