Repository navigation
Dark scheme and the Light | Dark | System choice - #81
Merged
Merged
Conversation
Every colour name gains a dark value: a warm dark paper, not black, with light ink that is never pure white. The Writer chooses Light, Dark or System in AI Settings. System is the default: no attribute is set and the stylesheet follows prefers-color-scheme itself, live and with no flash. Light or Dark sets data-theme on the root element. The choice is the colorScheme key in the existing settings store, normalised on load (unknown -> System), carried in a Backup. No Dexie migration. resolveColorScheme names the resolved scheme for the two theme-color metas, which now follow the scheme. The root is the ground colour, and a focus ring's offset follows paper, so an ink-filled control's ring in dark has no white band. A new agent gate fails the build on a raw palette colour class or palette variable in UI source. Part of #57. Closes #62. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 26, 2026
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.
Part of #57. Closes #62.
What changed
src/index.css). The page is a warm dark paper (#1f1d1a) a step above the ground (#191816), not black (story 206). Ink is light and never pure white. An ink fill becomes a light fill, withon-inkdark on it. Marks are still amber, now a deep amber wash with a bright underline so ink stays readable on them. Blue pencil comes in The mark: blue pencil, underlined at rest #64. The dark block is written once through adarkcustom variant that expands to@media (prefers-color-scheme: dark) :root:not([data-theme=light])and:root[data-theme=dark].color-schemefollows, so native controls and scrollbars match too.data-themeon<html>(src/settings/useColorScheme.ts). Nothing is mirrored into localStorage.resolveColorScheme(setting, systemPrefersDark)andisColorSchemeSettinginsrc/core/colorScheme.ts.colorSchemekey in the existingsettingsstore. It is normalised on load, so an unknown value becomes System, and it travels in a Backup. No Dexie migration.theme-color:index.htmlnow has two metas, one perprefers-color-scheme, set to the ground colour of each scheme. The hook gives each meta the resolved colour, so with System the browser switches between them with no script.public/manifest.webmanifest's statictheme_coloris left as it was.htmlis painted withground, and--tw-ring-offset-colordefaults topaper. In dark, an ink-filled control'sring-offset-2is no longer a white band. Light looks the same, because paper is white there.scripts/gates/palette.mjs, listed as "no palette colour class in the UI source". It reads string and template literals insrc/**/*.{ts,tsx}(tests excluded). It flags any palette class, whatever its variant or opacity (hover:bg-stone-100/60,text-white,ring-offset-white…), and any palette variable (--color-stone-100).Acceptance criteria
resolveColorScheme(setting, systemPrefersDark)is tested over the full table. Verified:src/core/colorScheme.test.tscovers all 6 rows and asserts the table covers every setting.colorSchemekey saves, loads, and normalises an unknown value to System. Verified:src/storage/settings.test.ts, same style as the existing keys. A Backup → Restore round-trip test is also insrc/storage/durability.test.ts.emulateMedia. Switching light → dark with no reload changed--color-groundandcolor-schemeat once, anddata-themestayed absent. On a reload with a dark OS, the root was already dark (#191816,color-scheme: dark) atDOMContentLoaded, before settings were read. Only checked against the dev server, where Vite injects the CSS through JS. In a production build the stylesheet is a blocking<link>, so it should hold there too, but that was not measured separately.data-theme="dark"). Setting System again removed the attribute.theme-colormatches the scheme. Verified: both metas read#fafaf9under Light and#191816under Dark. Under System each keeps its own colour.muted-ink, 14px) on paper is 7.48:1.faint-inkon paper is 6.12:1.pnpm run gatesis clean on the tree. Adding a probe file withhover:bg-stone-100failed the gate (exit 1, file and line reported), and the probe was then removed. Unit tests are inscripts/gates/palette.test.mjs.pnpm test(1069 passed),pnpm typecheck,pnpm run gatesandpnpm buildall pass.Notes
disabled:bg-rule text-on-ink, e.g. the Judge button with nothing selected) is low-contrast in dark, as it already is in light. It is disabled, so it was left alone.🤖 Generated with Claude Code
Generated by Claude Code