chadtmiller.com/group-host
atmosphere group host
0
0
A host's operator picks the console's palette as PALETTE
Mergedchadtmiller.com added 1 commit
Approved
This renames the operator's THEME to PALETTE. It does the same across Brand, the getBrand lexicon, compose, the docs and the tests. The console now marks the palette with a server-set <html data-palette> instead of a <meta> matched by :has().
I read every changed file and found nothing that must change.
- Attribute value:
paletteOfonly lets a known palette through (Object.hasOwn(INKS, …)), so nothing arbitrary reaches the attribute. - Timing:
palette()is evaluated insidetransformPageChunk, after the layout server load has setlocals.palette. The ordering the hook comment describes holds. - Specificity:
:root[data-palette='slate']has the same specificity the:has(meta…)selector had, so it still beats[data-theme='light']. - Load split: moving
getBrandinto+layout.server.tsand passing it throughevent.data.brandin+layout.tsis consistent. The extra serial request is already named in the body's shortcomings.
If getBrand fails, UNBRANDED gives no palette, so the page falls back to paper rather than erroring. That matches the old behaviour.
All checks have passed
6 passed
Merged as ab7d8ba
The operator's set of colours is now
PALETTE(wasTHEME), so "theme" no longer names two things: the reader's light or dark (data-theme) and the operator's palette. The console now marks the palette with<html data-palette>, set by the server hook, in place of a<meta name="theme">matched by:has().Claude Opus 5.5 · medium effort
What changes
The variable.
THEMEisPALETTE(GROUP_HOST_PALETTEin compose), with the same values,paperorslate. The host refuses any other value as before: "PALETTE is one of paper, slate, not neon".Brand.theme/THEMESareBrand.palette/PALETTES, andorg.atgrp.internal.getBrandanswerspalettein place oftheme. The lexicon isn't published yet, andjust lexpasses.The page. The root layout's server load (
+layout.server.ts) now readsgetBrand, so+layout.tsno longer does. The server load puts the palette inevent.locals.palette, and the hook'stransformPageChunkwritesdata-palette="slate"on<html>, as it already writesdata-themefor the reader's choice. Only a palette the console has gets in (paletteOfin#lib/brand.ts), andpapersets nothing.tokens.cssselects slate by:root[data-palette='slate'].The changeset already on this branch (
host-colours.md) now saysPALETTEandpalette.Changeset: none
Why
On
main,data-thememeans the reader's light or dark. Calling the operator's paletteTHEMEtoo gave selectors like:root:has(meta[name='theme'][content='slate'])[data-theme='dark'], with "theme" meaning two things. Renaming is free untilgetBrandis published. An attribute set by the server is the usual way to switch a set of tokens, wherethemeis no standard meta name. The reference PDS has no setting like this (onlyPDS_PRIMARY_COLORand the state colours), so there's no name to match.How it was checked
just t --test config --test brand: 11 passed, renamed variable and field included.npm run check(svelte-check, warnings failing): 0 errors.just lex,just fmt.PALETTE=slate PRIMARY_COLOR=#0f766e just look / --all: slate's cool paper, light and dark, with the teal button (pictures attached). Only the server sets the attribute, so slate showing means it arrived in the first byte.Shortcomings
getBrandis now read by the server load before the universal load asksgetViewer, one local request after the other where they used to run side by side. A host's brand doesn't change while it runs, so the console could keep it, but that's left for later.