chadtmiller.com/group-host
atmosphere group host
The console's colours are each written once, as light-dark()
MergedThis folds the repeated dark token blocks and the media query in tokens.css into one light-dark() per colour. color-scheme: light dark on :root picks between them, and [data-theme] forces one side. I compared the light and dark values against the removed blocks and found no difference. The shadows, the scrim and the --on-danger and --danger-soft tokens all match.
The avatar fallback is handled correctly. The --initial-* tokens are lightness and chroma pairs, so they can't go in light-dark(). The -dark twins and the span.av rule are the only users, and I found no other reference to these tokens. brandStyle still writes plain rules, so its overrides keep working, and the comment in brand.ts gives the reason.
I couldn't run the build, so I didn't check the Lightning CSS rewrite for older Safari. The author says they checked it in Chromium and not on a real Safari 16 or 17. The Changeset: none line is there for the check, which reads the body.
5 passed, 1 skipped
Every colour token is now written once, as
light-dark(light, dark), and the page'scolor-schemepicks between them. Before, the full set was repeated underprefers-color-scheme: darkand again under[data-theme='dark']. Nothing anyone sees changes: every palette, light and dark, draws the same pixels as before.Claude Opus 5.5 · medium effort
What changes
tokens.css.:rootsetscolor-scheme: light dark, and every colour token islight-dark(light, dark), the shadows and scrim included (per shadow layer). A reader's choice is[data-theme='light'] { color-scheme: light }or[data-theme='dark'] { color-scheme: dark }. The two dark blocks and the media query are gone.The avatar's initial.
--initial-washand--initial-inkare a lightness and chroma, not colours, so they can't go inlight-dark(). Each now has a-darktwin, andspan.avinapp.csspicks between them withlight-dark(oklch(var(--initial-wash) var(--hue)), oklch(var(--initial-wash-dark) var(--hue))).brandStylekeeps its three rules. It writes a<style>as the page is drawn, after the build. The build lets older browsers readlight-dark()(below), but a runtime style gets no such help, solight-dark()there would need Safari 17.5. A comment inbrand.tssays so.Older browsers. Vite 8's CSS minifier, Lightning CSS, targets Vite's default
baseline-widely-available(Safari 16.4). For that target it rewriteslight-dark()into its--lightningcss-light/--lightningcss-darkswitch, inside custom properties too, and writes the matchingprefers-color-schemeand[data-theme]rules. The built stylesheet therefore works without nativelight-dark();vite devserves it natively.The
.alonebackdrop rules inapp.cssstill use the media query, because they switch background images, whichlight-dark()doesn't take in today's browsers.Changeset: none
Why
The same 20-odd tokens were written three times: in
:root, under the media query, and under[data-theme='dark']. Changing a dark colour meant changing two places, and a missed one showed only to readers who had chosen dark. Withlight-dark(), each colour is one line with both values side by side.How it was checked
/g/lanterns.groups.testas alice with--seed full, light and dark, in all five palettes, and compared against the pictures from before. Page background and card colours are identical. The top of each page (header and group card) differs by at most 1 in one channel, along the header's edge. The other difference is the group's picture, which loaded in one world and not the other. Where a group's initial was drawn, its wash and ink are identical before and after: light (219,226,193)/(74,83,13), dark (54,59,28)/(205,216,163).vite dev(nativelight-dark()) and the built console (node build, rewritten for older browsers):data-themenpm run check: 0 errors, 0 warnings.just fmtandnode harness/strings.mjspass.Shortcomings
brandStyle's dark colour withoutPRIMARY_COLOR_DARKusesoklch(from …), relative colour syntax, which needs Safari 18; that predates this pull. On Safari 16.4–17.x, a host withPRIMARY_COLORand noPRIMARY_COLOR_DARKgets a--primarybrowsers can't read in dark, and its buttons lose their fill. Working out the lifted colour inbrand.tswould fix that; it's left for its own pull.