feat(studio): graphite colour system with a light theme that passes contrast - #4836
Merged
Merged
Conversation
…ontrast Studio's tokens take the Graphite values: a lifted dark, a light set behind data-theme="paper", the player dark in both. Every text role clears 4.5:1 and every icon and ring 3:1 on the fills it sits on, held by the contrast ratchet.
Edit accuracy: 557 passing here, 557 on the base branchThe gate passes. Unstable (1)
|
…contrast The dock no longer inherits dockview's forced dark scheme, popovers sit on the raised surface, stock white, red and amber text map to roles, the keyframe diamonds and track headers use roles, and the contrast ratchet measures every pair in both themes (150 pairs).
… fills use roles Round-two review: white, red and amber are colour content as well as text, so they keep Tailwind's values and hosts keep their palettes. Text, toasts, the feedback card, the FX popover, destructive buttons, category labels and the dock take Graphite roles instead; the contrast gate rejects an unparseable colour.
…s contrast Stock white, red, amber and file-type hex left in Studio chrome now use roles or a light-dark pair; the file tree icons carry a contrast test.
… in both themes Danger graphics use the danger ink, file tree outlines use the accent ink, the colour-curve well stays dark like the scopes, and six timeline token pins come back.
…tay distinct in both themes The invalid readout border is dashed as well as red, the curve graph's ring sits inside its dark well, the radius dots and ease handle centre follow the theme.
…hed invalid border has a test Simplify pass: the ease editor's inline accent styles become stroke and fill classes, the radius dot class is computed once, the ratio check is one expression, and the alias table is named for what it holds.
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.
What changes for a person using Studio
Studio's colours move to Graphite: a softer, lifted dark (the shell was near-black), and a full light theme. Every text pairing clears WCAG 4.5:1 and every icon, border, dot and focus ring clears 3:1, on every surface and state it can sit on. The player and the audio meter stay dark in both themes.
How
theme.cssislight-dark(light, dark), so thecolor-schemewhere a colour is painted picks its half. Studio is dark;data-theme="paper"on the document element (the existing host hook) makes it light; the preview pane and the audio meter setscheme-dark, so they stay dark inside a light Studio with no copied values. The scheme rule sits in the base layer, so a host's owncolor-schemewins.raised(menus, popovers),press,on/on-hover(toggle on),accent-hover,accent-ink(accent text),on-accent(text on an accent fill),ring,danger-ink,on-danger,warning-ink,text-off(disabled only). States and lines are washes of the text colour (color-mix), so they work on any surface.white,red-*andamber-*keep their upstream values, so a host's own palette is untouched.--color-neutral-*points at roles by the job each step does in markup (light steps are text, dark steps are surfaces and lines).raised, flat buttons go hover then press; the timeline toolbar has four readable states (idle, hover, on, on+hover).color-scheme: darkon its default theme class; the shell around Studio's dock now inherits Studio's scheme.scripts/contrast.tsreadsoklch(),light-dark(),color-mix(... transparent)and nestedvar(), and a theme can reuse another's pairs (pairsFrom). The manifest measures every timeline pair and every chrome role against every fill it sits on, in both themes: 146 pairs pass, and the debt baseline (11 failing timeline pairs on main) is empty. A second test measures every file-type icon colour on a row at rest, hovered and selected, in both themes.opacity: 0.5).Before
Main, dark (main has no light theme for the editor; its
paperhook only recoloured the timeline).After
Dark, then light (
data-theme="paper"), on the repo'sproduct-promoexample.Three window sizes
The editor shell at 1280x800, 1440x900 and 1920x1080, dark then light. The rendered sweep finds 0 items under target at every size in both themes.
Rendered contrast, measured in the built Studio
A headless Chromium 147 sweep of every visible text run (4.5:1) and svg icon (3:1) against the colours actually painted beneath it, at 1440x900. Failing items out of items checked.
The Layers, Renders and Variables views keep the code tab open beside them, so they show the same 40 to 42 code-editor items and nothing else.
Named exceptions
animate-pulse); at the trough its label dips below 4.5:1, at rest and at the peak it passes. Left as is; the pulse is the badge's signal.light-dark()orcolor-mix;theme.cssis the source.light-dark()needs Chrome 123, Safari 17.5 or Firefox 120. Verified in Chromium 147 only.theme.cssand themes by its own attribute setscolor-schemeitself (light or dark); tokens it does not override then follow it.Verification
scripts/contrastRatchet.test.ts: 146 pairs, 0 baseline debts; the file-type icon test fails when one icon goes back to its old light colour (1.68:1, the same figure the rendered sweep measured).packages/studio: the full unit suite, 6310 tests pass. The hex ratchet baseline is lowered.tsc --noEmiton packages/studio: exit 0. oxlint on the changed files: 0 warnings, 0 errors. oxfmt: clean.fallow audit --base(the CI command): exit 0.