The interface has a light side - #599
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Contributor
Author
|
Review before merge (code only; the running app still has to be looked at). Not mergeable yet: backend and migrations are red because of this PR, and the default theme regresses. Blocking
Not blocking
Checked and fine: all 61 light overrides exist on |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
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.
A light theme, and the sweep that makes one possible: every colour in the web app is now a token, and the canvas reads the tokens at runtime.
What a person sees
The user menu gains a Theme section under Language: Dark (the default and the brand), Light, Follow system. The choice lives in the browser (
utopia.theme), like the language — it never reaches the backend. A small inline script inindex.htmlapplies it before first paint, so a refresh does not flash dark and then turn light.Light is paper, not white: ground
#fafafa, ink#171717/#5f5f5f, lines and surfaces become black-at-alpha with the same alpha values as dark (they describe hierarchy, not colour), and the five meaning colours get a deeper version of the same hue (pale rose and pale gold do not read on paper).The sweep
Rule 4 of DESIGN.md says colour is a token, never a value. It was enforced for Tailwind classes only; strings in TS and rules in
styles.csshad 56 raw values in pages and 55 more in the stylesheet — every one of them "white on dark", which is exactly what breaks when the ground flips.styles.css: 41 new tokens; the two RGB triplets--u-ink-rgb/--u-ground-rgbcarry everyrgba(255,255,255,α)andrgba(10,10,10,α)with the alpha left where it was; canvas tokens (--u-node-*,--u-edge-*,--u-halo,--u-scrub-*), surfaces for scrim / pop / modal / card, a code-highlight palette. Outside the three token blocks there is no colour value left in the stylesheet.graphVisuals.tsis now the reader: its exports are liveletbindings filled byrefreshPalette()fromgetComputedStyle(canvas cannot readvar()); Graph and the schema graph call it before they build (node shells and edge colours are baked into graph attributes) and rebuild ononThemeChange. The two pages' own colour constants are gone.src/palette.ts— it is data colour (rule 4 allows it) and must stay byte-identical tocrates/utopia-store/src/palette.rs. A paper-tuned variant would have to change both sides; not in this cut.style-guardgainsraw-colour:#rrggbborrgba(anywhere insrc/**/*.ts{,x}fails the build, except the two reader files, test fixtures andrgba(0,0,0,0). It now also scans.ts(the canvas and the login scene live there) and ignores block comments. 72 files, 0 violations.Checked in the browser
Both themes on Graph (16 entities, edges, scrubber), Ontology (schema graph), Chat, Library, Settings, and the 500 page. Switching through the real menu re-bakes the canvas without a reload:
pnpm build(guard + tsc + vite) and 19 web tests green;theme.tshas a unit test for the three-way resolution.Not in this cut
A paper-tuned entity palette (server and client together); the canvas edge label work is unrelated. The default stays dark.
🤖 Generated with Claude Code