oficina / estilo Public

theme: Calma declares rastrillo v0.37.0's 69 newer tokens, at their fallbacks

Home's move to rastrillo v0.37.0 (smart-door step 3) needs Calma to declare
every token rastrillo's day theme does. The 69 new ones are set to the
fallback v0.37.0's tokens.css uses, so rastrillo's own stylesheet draws what
it did and the gate stays strict. An app's CSS with its own different
fallback still changes: Fichas' rail must change in its estilo bump
(AGENTS.md, Theme). Adopting Fiesta's depth and sheen is Paul's call.

Reviewed by Claude Fable: APPROVE AFTER FIXES, fixes in ad7f705. CI passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from fix/calma-rastrillo-037-tokens into main.
Co-Authored-By: claude <claude~paul@keymail.dev>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 14a3d52fdf874bad5adba89375ae75ce1a9631b2 parent 32d47f1
4 files changed, +257 −9
  • AGENTS.md +22 −2
  • theme/estilo.css +93 −0
  • theme/testdata/rastrillo-day-tokens.txt +104 −0
  • theme/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.005s
ok  	amadan.net/oficina/estilo.git/brand	0.002s
ok  	amadan.net/oficina/estilo.git/busy	0.009s
ok  	amadan.net/oficina/estilo.git/callui	0.006s
ok  	amadan.net/oficina/estilo.git/chrome	2.687s
?   	amadan.net/oficina/estilo.git/cmd/oficina-notices	[no test files]
ok  	amadan.net/oficina/estilo.git/colophon	0.021s
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.501s
ok  	amadan.net/oficina/estilo.git/homeconnect	0.005s
ok  	amadan.net/oficina/estilo.git/internal/lint	0.006s
?   	amadan.net/oficina/estilo.git/internal/tokencheck	[no test files]
ok  	amadan.net/oficina/estilo.git/menu	0.015s
ok  	amadan.net/oficina/estilo.git/savestatus	0.120s
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..fea53fd 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -110,9 +110,29 @@ 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 rastrillo's own stylesheet draws exactly what it did. That
+ equality was checked by hand against v0.37.0 (Fiesta 1.3.0) only;
+ nothing pins it, so re-check it whenever the snapshot is regenerated
+ (Fiesta 1.5.0, for one, falls back `--rst-focus-edge` to the accent).
+ **An app's own CSS can still change** if it reads one of these tokens
+ with a different fallback: Fichas' `frame.css` reads
+ `var(--rst-rail-bg, var(--rst-bg))`, so its rail turns
+ `--rst-surface` when it bumps past this commit, unless that line
+ becomes `var(--rst-bg)` in the same bump. Check each app's CSS for
+ `var(--rst-…, …)` reads of these tokens when it bumps. 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..37b466f 100644
--- a/theme/estilo.css
+++ b/theme/estilo.css
@@ -84,6 +84,99 @@
--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
+ rastrillo's own stylesheet draws exactly what it did before they were
+ declared, and the gate (TestDeclaresRastrilloTokens) stays strict. An
+ app's CSS that reads one of these with a different fallback of its
+ own does change (Fichas' rail; AGENTS.md, Theme).
+ 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.