chadtmiller.com/group-host
atmosphere group host
A host's operator sets the colour that acts, and a cooler set of colours
MergedThis adds PRIMARY_COLOR, PRIMARY_COLOR_DARK and THEME to the host config. They reach the console through getBrand, where brandStyle writes the <style> and slate's tokens are chosen by a <meta>. I read the colour and theme parts of the diff: config, brand.rs, brand.ts, +layout.svelte, tokens.css and the lib.rs and app.css hunks. I did not read the rest of the stacked approval-page pull, which has its own review. I didn't run anything, and I didn't check the tests, docs or lexicon for this part.
The host-side validation looks right. Specificity works out: html:root and html[data-theme=…] beat the token rules. Only a regex-checked hex reaches the <style>.
One thing needs fixing. The "Shortcomings" claim that older browsers "keep the console's own" dark colour is wrong for the derived dark colour (see the comment on brand.ts).
web/src/lib/brand.tsline 78
const d = | |
given && HEX.test(given) | |
? acting(given, onColour(given, darkInk), true) | |
: acting(`oklch(from ${light} max(l, 0.72) c h)`, darkInk, true); |
This will not fall back as the body says. --primary: oklch(from …) is a valid custom-property declaration in every browser. It only goes invalid when var(--primary) is used, and then it computes to unset, not to the console's own terracotta. So on a browser without relative colour syntax, the dark scheme gets no primary background or link colour. --on-primary and the color-mixes off it also break. Wrap the derived dark block in @supports (color: oklch(from red l c h)), so older browsers skip it and keep the token defaults. Alternatively, derive the lighter colour in TS.
A host's operator can now set the colour of the console's buttons and links (
PRIMARY_COLOR,PRIMARY_COLOR_DARK), and switch the rest of its colours from warm paper to a cool slate (THEME=slate). Stacked on the approval-page pull; the diff includes it until that one lands.Claude Opus 5.5 · high effort
What changes
Host.
PRIMARY_COLORandPRIMARY_COLOR_DARKtake only#rgbor#rrggbband are kept lower case.THEMEtakespaperorslate;paper, the console's own set, counts as unset. The host refuses to start on any other value.getBrandanswerscolors(primary,primaryDark) andtheme.Console.
brandStylein#lib/brand.tswrites a<style>into the head that sets--primaryand the tokens drawn from it:--primary-hover,--primary-softand--link-linearecolor-mixes of it.--on-primaryis white or the theme's ink, whichever reads better by WCAG contrast.oklch(from …)), with dark ink on it.Its selectors carry one more element than the tokens', so they win in either order and in a forced light or dark scheme. Only a colour matching
#rgb/#rrggbbis written in, checked again here, though the host already checks.THEME=slateputs<meta name="theme" content="slate">in the head.tokens.cssgives slate's surfaces, ink, lines and shadows under:root:has(meta[name='theme'][content='slate']), light and dark, so every token stays intokens.css. Slate sets no--primary: what acts is the operator's colour, or terracotta.Why
A host run by an app wants its pages in that app's colours. A primary colour alone on warm paper looked like someone else's site for Grain, so there is one built-in cool set beside it. The neutral colours stay presets, not free values, so their contrast is checked once rather than per host.
How it was checked
tests/config.rs: colours read and lower-cased,#rgbkept, four malformed colours and an unknown theme refused,paperread as unset.tests/brand.rs:getBrandanswerscolorsandtheme.just lookwith Grain's#3b4ddb/#85a1ffand slate: a group's page in light, the approval page on a phone in dark. With only#0f766e: home in light, and in dark with the derived lighter teal and dark ink on it.just lex, docs links.Shortcomings
oklch(from …)needs Chrome 119, Safari 16.4 or Firefox 128. Older browsers drop the derived dark colour and keep the console's own.:has()needs Chrome 105, Safari 15.4 or Firefox 121. Older browsers draw slate's pages in paper.