theme: Calma declares rastrillo v0.37.0's 69 newer day tokens, at their fallbacks
rastrillo v0.37.0's day (Fiesta 1.3.0) declares 69 tokens that the v0.23.0 set Calma was built on did not. Home's TestVendoredAssetsMatchTheLibrary fails on its rastrillo upgrade until Calma declares them. Each is set to the exact fallback v0.37.0's tokens.css uses where it reads the token (one fallback per token; checked), so pages render as they do today. Adopting Fiesta's depth, light and sheen is a separate design decision for Paul. TestDeclaresDaysTokenSet becomes TestDeclaresRastrilloTokens: estilo.css must declare exactly the names in testdata/rastrillo-day-tokens.txt, a snapshot of v0.37.0's day, and the snapshot must cover the pinned v0.23.0's day, read live. A snapshot because requiring a newer rastrillo here would pull every app up to it. AGENTS.md updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+246
−9
AGENTS.md+13 −2theme/estilo.css+91 −0theme/testdata/rastrillo-day-tokens.txt+104 −0theme/theme_test.go+38 −7
CI passed — run details
CI log
=== modcache === all modules verified === vet === CGO_ENABLED=0 go vet ./... CGO_ENABLED=0 go vet -tags browser ./... === fmt === === build === CGO_ENABLED=0 go build -buildvcs=false ./... === go-test === CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/estilo.git/base 0.004s ok amadan.net/oficina/estilo.git/brand 0.003s ok amadan.net/oficina/estilo.git/busy 0.010s ok amadan.net/oficina/estilo.git/callui 0.004s ok amadan.net/oficina/estilo.git/chrome 2.908s ? amadan.net/oficina/estilo.git/cmd/oficina-notices [no test files] ok amadan.net/oficina/estilo.git/colophon 0.024s ok amadan.net/oficina/estilo.git/credits 0.005s ok amadan.net/oficina/estilo.git/credits/catalog 0.004s ok amadan.net/oficina/estilo.git/desk 0.004s ok amadan.net/oficina/estilo.git/googleimport 1.151s ok amadan.net/oficina/estilo.git/homeconnect 0.006s ok amadan.net/oficina/estilo.git/internal/lint 0.007s ? amadan.net/oficina/estilo.git/internal/tokencheck [no test files] ok amadan.net/oficina/estilo.git/menu 0.014s ok amadan.net/oficina/estilo.git/savestatus 0.114s ok amadan.net/oficina/estilo.git/sky 0.030s ok amadan.net/oficina/estilo.git/theme 0.011s
diff --git a/AGENTS.md b/AGENTS.md| index 7ac3551..25e42c3 100644 |
| --- a/AGENTS.md |
| +++ b/AGENTS.md |
| @@ -110,9 +110,20 @@ What Calma is, and where each part lives: |
| **The gates that replaced `TestMatchesDayByteForByte`** |
| (`theme/theme_test.go`), and why each exists: |
| -- `TestDeclaresDaysTokenSet` — exactly `day`'s token *names*, so |
| +- `TestDeclaresRastrilloTokens` — exactly `day`'s token *names*, so |
| rastrillo's `tokens.css` never meets an undefined `var(--rst-*)`, and |
| - a rastrillo upgrade that adds or drops a token still fails here. |
| + a rastrillo upgrade that adds or drops a token still fails here. Two |
| + sources: the pinned v0.23.0's `day`, live, and the newest rastrillo an |
| + app pins, as a snapshot in `theme/testdata/rastrillo-day-tokens.txt` |
| + (v0.37.0 since 2026-11-20). A snapshot, because requiring a newer |
| + rastrillo here would pull every app up to it. When an app moves to a |
| + newer rastrillo, regenerate the snapshot from that release's `day`. |
| + The 69 tokens rastrillo added between v0.23.0 and v0.37.0 (Fiesta's |
| + fills, controls, tints, switches, type, and depth, light and sheen) |
| + are declared at **the fallback v0.37.0's `tokens.css` uses for each**, |
| + so declaring them changed nothing on screen. Adopting Fiesta's depth |
| + and sheen, or any other value for them, is a design decision for |
| + Paul like any token change below. |
| - `TestContrastMeetsWCAG` — every pair rastrillo's own gate checks, in |
| both schemes, for estilo.css **and every app's accent**, through |
| rastrillo's `ui.ContrastRatio` (parsing copied verbatim). |
diff --git a/theme/estilo.css b/theme/estilo.css| index fa8ef90..3d729b8 100644 |
| --- a/theme/estilo.css |
| +++ b/theme/estilo.css |
| @@ -84,6 +84,97 @@ |
| --rst-shadow-knob: 0 1px 2px rgba(20, 24, 33, 0.3); |
| --rst-shadow-lift: 0 1px 1px rgba(20, 24, 33, 0.04), 0 14px 36px -14px light-dark(rgba(20, 24, 33, 0.22), rgba(0, 0, 0, 0.55)); |
| --rst-overlay: light-dark(rgba(20, 24, 33, 0.45), rgba(0, 0, 0, 0.6)); |
| + |
| + /* ── Tokens rastrillo added after v0.23.0 ────────────────────────── |
| + rastrillo v0.37.0 (its look from Fiesta 1.3.0) has day declare these |
| + 69 tokens beyond the set Calma was built on. Each is set to the |
| + fallback rastrillo v0.37.0's tokens.css uses where it reads it, so |
| + a page looks exactly as it did before they were declared: the gate |
| + (TestDeclaresRastrilloTokens) stays strict and nothing moves. |
| + Adopting Fiesta's depth, light and sheen, or any value here other |
| + than its fallback, is a separate design decision for Paul (AGENTS.md, |
| + Theme), not a pin bump. */ |
| + |
| + /* Filled buttons: the accent and danger fills, their edges and labels. */ |
| + --rst-accent-fill: var(--rst-accent); |
| + --rst-accent-fill-hover: var(--rst-accent-strong); |
| + --rst-accent-fill-edge: var(--rst-accent); |
| + --rst-accent-fill-edge-hover: var(--rst-accent-strong); |
| + --rst-on-accent-fill: var(--rst-on-accent); |
| + --rst-danger-fill: var(--rst-tone-negative-fg); |
| + --rst-danger-fill-hover: var(--rst-tone-negative-fg); |
| + --rst-danger-fill-edge: var(--rst-tone-negative-fg); |
| + --rst-danger-fill-edge-hover: var(--rst-tone-negative-fg); |
| + --rst-on-danger-fill: var(--rst-on-accent); |
| + --rst-on-danger-fill-hover: var(--rst-on-accent); |
| + --rst-danger-hover-filter: brightness(0.9); |
| + |
| + /* Controls, ghost buttons and disclosure summaries. */ |
| + --rst-control-face: var(--rst-surface); |
| + --rst-control-face-hover: var(--rst-surface); |
| + --rst-control-face-press: transparent; |
| + --rst-control-border: var(--rst-line-strong); |
| + --rst-control-border-hover: var(--rst-accent); |
| + --rst-control-text-hover: var(--rst-accent); |
| + --rst-ghost-edge: var(--rst-line-strong); |
| + --rst-ghost-edge-hover: var(--rst-line-strong); |
| + --rst-ghost-face-hover: transparent; |
| + --rst-summary-face: transparent; |
| + --rst-summary-face-hover: transparent; |
| + --rst-summary-edge: transparent; |
| + --rst-summary-edge-hover: transparent; |
| + --rst-summary-radius: 0; |
| + |
| + /* Focus, hover and press tints. */ |
| + --rst-focus-edge: var(--rst-line-strong); |
| + --rst-focus-halo: transparent; |
| + --rst-tint-hover: var(--rst-accent-soft); |
| + --rst-tint-press: var(--rst-accent-soft); |
| + --rst-tint-tap: transparent; |
| + --rst-tint-card-hover: transparent; |
| + --rst-tint-group-hover: transparent; |
| + --rst-tint-tile-hover: var(--rst-surface); |
| + --rst-tint-tile-press: var(--rst-surface); |
| + --rst-row-tint-hover: var(--rst-surface-2); |
| + --rst-row-tint-press: var(--rst-surface-2); |
| + |
| + /* Fiesta's depth, light and sheen: all off, as the fallbacks have them. */ |
| + --rst-depth-face: 0; |
| + --rst-depth-hl: transparent; |
| + --rst-depth-contact: transparent; |
| + --rst-depth-ambient: transparent; |
| + --rst-light-rim: var(--rst-line); |
| + --rst-light-wash: transparent; |
| + --rst-sheen-fill: transparent; |
| + --rst-sheen-plain: transparent; |
| + --rst-press-drop: 0px; |
| + --rst-press-wash: 0; |
| + --rst-press-spot: 0; |
| + --rst-press-wash-plain: 0; |
| + --rst-press-spot-plain: 0; |
| + |
| + /* Switches. */ |
| + --rst-knob: var(--rst-surface); |
| + --rst-knob-shade: var(--rst-surface); |
| + --rst-shadow-knob-hover: var(--rst-shadow-knob); |
| + --rst-track-off: var(--rst-line-strong); |
| + --rst-switch-w: 34px; |
| + --rst-switch-h: 19px; |
| + --rst-switch-knob: 15px; |
| + --rst-switch-touch-w: 34px; |
| + --rst-switch-touch-h: 19px; |
| + --rst-switch-touch-knob: 15px; |
| + |
| + /* Type and navigation. */ |
| + --rst-title-size: 1.375rem; |
| + --rst-title-weight: 600; |
| + --rst-title-track: -0.015em; |
| + --rst-heading-size: var(--rst-fs-base); |
| + --rst-label-case: uppercase; |
| + --rst-label-track: 0.06em; |
| + --rst-rail-bg: var(--rst-surface); |
| + --rst-nav-current-bg: var(--rst-accent-soft); |
| + --rst-nav-current-fg: var(--rst-accent); |
| } |
| /* The whole toggle. Setting color-scheme re-resolves every light-dark() |
diff --git a/theme/testdata/rastrillo-day-tokens.txt b/theme/testdata/rastrillo-day-tokens.txt| new file mode 100644 |
| index 0000000..03c64f0 |
| --- /dev/null |
| +++ b/theme/testdata/rastrillo-day-tokens.txt |
| @@ -0,0 +1,104 @@ |
| +# The custom-property names rastrillo v0.37.0's day theme declares |
| +# (ui.ThemeCSS("day"), Fiesta 1.3.0's css/themes/day.css), one per line. |
| +# A snapshot, because estilo pins rastrillo v0.23.0 and must not require a |
| +# newer one: estilo's apps would all be pulled up with it. Regenerate it |
| +# from the newest rastrillo an Oficina app pins, then declare whatever it |
| +# adds in theme/estilo.css; TestDeclaresRastrilloTokens holds the two equal. |
| +--rst-accent |
| +--rst-accent-fill |
| +--rst-accent-fill-edge |
| +--rst-accent-fill-edge-hover |
| +--rst-accent-fill-hover |
| +--rst-accent-soft |
| +--rst-accent-strong |
| +--rst-bg |
| +--rst-control-border |
| +--rst-control-border-hover |
| +--rst-control-face |
| +--rst-control-face-hover |
| +--rst-control-face-press |
| +--rst-control-text-hover |
| +--rst-danger-fill |
| +--rst-danger-fill-edge |
| +--rst-danger-fill-edge-hover |
| +--rst-danger-fill-hover |
| +--rst-danger-hover-filter |
| +--rst-depth-ambient |
| +--rst-depth-contact |
| +--rst-depth-face |
| +--rst-depth-hl |
| +--rst-focus-edge |
| +--rst-focus-halo |
| +--rst-font |
| +--rst-ghost-edge |
| +--rst-ghost-edge-hover |
| +--rst-ghost-face-hover |
| +--rst-header-rule |
| +--rst-heading-size |
| +--rst-knob |
| +--rst-knob-shade |
| +--rst-label-case |
| +--rst-label-track |
| +--rst-light-rim |
| +--rst-light-wash |
| +--rst-line |
| +--rst-line-strong |
| +--rst-nav-current-bg |
| +--rst-nav-current-fg |
| +--rst-on-accent |
| +--rst-on-accent-fill |
| +--rst-on-danger-fill |
| +--rst-on-danger-fill-hover |
| +--rst-overlay |
| +--rst-press-drop |
| +--rst-press-spot |
| +--rst-press-spot-plain |
| +--rst-press-wash |
| +--rst-press-wash-plain |
| +--rst-radius |
| +--rst-radius-pill |
| +--rst-radius-sm |
| +--rst-rail-bg |
| +--rst-row-tint-hover |
| +--rst-row-tint-press |
| +--rst-shadow-knob |
| +--rst-shadow-knob-hover |
| +--rst-shadow-lift |
| +--rst-shadow-pop |
| +--rst-sheen-fill |
| +--rst-sheen-plain |
| +--rst-summary-edge |
| +--rst-summary-edge-hover |
| +--rst-summary-face |
| +--rst-summary-face-hover |
| +--rst-summary-radius |
| +--rst-surface |
| +--rst-surface-2 |
| +--rst-switch-h |
| +--rst-switch-knob |
| +--rst-switch-touch-h |
| +--rst-switch-touch-knob |
| +--rst-switch-touch-w |
| +--rst-switch-w |
| +--rst-text |
| +--rst-text-faint |
| +--rst-text-muted |
| +--rst-tint-card-hover |
| +--rst-tint-group-hover |
| +--rst-tint-hover |
| +--rst-tint-press |
| +--rst-tint-tap |
| +--rst-tint-tile-hover |
| +--rst-tint-tile-press |
| +--rst-title-size |
| +--rst-title-track |
| +--rst-title-weight |
| +--rst-tone-negative-bg |
| +--rst-tone-negative-fg |
| +--rst-tone-neutral-bg |
| +--rst-tone-neutral-fg |
| +--rst-tone-positive-bg |
| +--rst-tone-positive-fg |
| +--rst-tone-warning-bg |
| +--rst-tone-warning-fg |
| +--rst-track-off |
diff --git a/theme/theme_test.go b/theme/theme_test.go| index f80aace..4ef5039 100644 |
| --- a/theme/theme_test.go |
| +++ b/theme/theme_test.go |
| @@ -18,9 +18,10 @@ import ( |
| // with that ruling. What replaces it holds Calma to the same bars day was |
| // held to, on its own values: |
| // |
| -// - TestDeclaresDaysTokenSet: the same token NAMES as the pinned day, |
| -// so rastrillo's tokens.css never meets an undefined var(--rst-*), |
| -// and a rastrillo upgrade that adds or drops a token still fails here. |
| +// - TestDeclaresRastrilloTokens: the same token NAMES as rastrillo's |
| +// day, the pinned one and the newest an app pins (a snapshot), so |
| +// rastrillo's tokens.css never meets an undefined var(--rst-*), and a |
| +// rastrillo upgrade that adds or drops a token still fails here. |
| // - TestContrastMeetsWCAG: every pair rastrillo's own gate checks, in |
| // both schemes, for estilo.css and for every app's accent. |
| // - TestAccentGoldens: each app's accent block against testdata, so no |
| @@ -113,14 +114,44 @@ func names(css []byte) []string { |
| return out |
| } |
| -func TestDeclaresDaysTokenSet(t *testing.T) { |
| +// TestDeclaresRastrilloTokens: estilo.css declares exactly the token |
| +// names rastrillo's day declares, so rastrillo's tokens.css never meets |
| +// an undefined var(--rst-*) on a Calma page. Two sources, because estilo |
| +// pins rastrillo v0.23.0 while its apps run newer ones: |
| +// |
| +// - day at the pinned v0.23.0, read live through ui.ThemeCSS; |
| +// - day at the newest rastrillo an app pins (v0.37.0 today), from the |
| +// snapshot testdata/rastrillo-day-tokens.txt. Estilo cannot import |
| +// that rastrillo: requiring it here would pull every app up to it. |
| +// |
| +// The snapshot must cover the live set, and estilo.css must declare |
| +// exactly the snapshot: a token added upstream fails here once the |
| +// snapshot is refreshed, and a stray one fails always. |
| +func TestDeclaresRastrilloTokens(t *testing.T) { |
| day, ok := ui.ThemeCSS("day") |
| if !ok { |
| t.Fatal(`ui.ThemeCSS("day") returned false -- rastrillo no longer ships a theme named "day"`) |
| } |
| - want, got := names(day), names(css) |
| - if strings.Join(want, " ") != strings.Join(got, " ") { |
| - t.Fatalf("estilo.css must declare exactly day's token names (tokens.css uses them):\n day: %v\n estilo: %v", want, got) |
| + raw, err := os.ReadFile(filepath.Join("testdata", "rastrillo-day-tokens.txt")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var snapshot []string |
| + inSnapshot := map[string]bool{} |
| + for _, line := range strings.Split(string(raw), "\n") { |
| + if line = strings.TrimSpace(line); line != "" && !strings.HasPrefix(line, "#") { |
| + snapshot = append(snapshot, line) |
| + inSnapshot[line] = true |
| + } |
| + } |
| + sort.Strings(snapshot) |
| + for _, name := range names(day) { |
| + if !inSnapshot[name] { |
| + t.Errorf("the pinned rastrillo's day declares %s, which testdata/rastrillo-day-tokens.txt lacks; regenerate the snapshot", name) |
| + } |
| + } |
| + if got := names(css); strings.Join(snapshot, " ") != strings.Join(got, " ") { |
| + t.Fatalf("estilo.css must declare exactly rastrillo day's token names (tokens.css uses them):\n day: %v\n estilo: %v", snapshot, got) |
| } |
| // The toggle, too: it is the only way an explicit Appearance choice |
| // beats the OS. |