oficina / calendar Public

Calendar's screens on the spacing scale, and the two gates

WIP: see the branch discussion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 250a501f05b4006ef4e7e2ce96a7adac2bcfe73d parent b9042ea
14 files changed, +383 −82
  • .amadan/ci.d/25-spacing +2 −0
  • AGENTS.md +2 −2
  • Makefile +15 −3
  • README.md +1 −1
  • go.mod +8 −4
  • go.sum +8 −6
  • internal/calendar/credits/notices.json +2 −2
  • internal/calendar/static/brand/brand.css +1 −1
  • internal/calendar/static/calendar.css +4 −5
  • internal/calendar/static/chrome.css +104 −49
  • internal/calendar/static/menu.css +8 −8
  • internal/calendar/static/tokens.css +84 −0
  • internal/calendar/templates/layout.html +4 −1
  • internal/calendartest/rhythm_browser_test.go +140 −0

CI passed — run details

CI log
=== vet ===
go vet ./...
go vet -tags browser ./internal/calendartest/ ./internal/calendar/
=== fmt ===
=== spacing ===
go tool fiesta spacing -skip tokens.css -skip theme.css -skip busy.css -skip chrome.css -skip menu.css -skip sky.css -skip base.css internal/calendar/static
=== test ===
go test ./...
ok  	amadan.net/oficina/calendar/cmd/calendar	0.125s
?   	amadan.net/oficina/calendar/cmd/calendar-contract	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendar	28.799s
?   	amadan.net/oficina/calendar/internal/calendar/icons	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/keymailtest	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/seal	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/teamstate	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendartest	4.043s
ok  	amadan.net/oficina/calendar/internal/guardstest	0.094s
?   	amadan.net/oficina/calendar/scripts/writeestilo	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
diff --git a/.amadan/ci.d/25-spacing b/.amadan/ci.d/25-spacing
new file mode 100755
index 0000000..53c0bd3
--- /dev/null
+++ b/.amadan/ci.d/25-spacing
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make spacing
diff --git a/AGENTS.md b/AGENTS.md
index 98b833f..9911589 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -389,8 +389,8 @@ Squash-merge only when the work is done, it is approved, and CI is
actually green — checked, not assumed. Review on a deployed canary,
never localhost.
-`make ci` is the one gate: vet, gofmt, tests, migration check. The same
-definition CI runs. Run it before every push.
+`make ci` is the one gate: vet, gofmt, the spacing check, tests,
+migration check. The same definition CI runs. Run it before every push.
## Review
diff --git a/Makefile b/Makefile
index 520efa3..8e80f47 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ RELEASE_BIN := releases/$(APP)-$(RELEASE_GOOS)-$(RELEASE_GOARCH)
# make release VERSION=v0.1.0
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null)
-.PHONY: build release version-check deps test vet fmt-check migration-check ci browser
+.PHONY: build release version-check deps test vet fmt-check spacing migration-check ci browser
# build is the compile check: with more than one package matched, go
# build discards the output, so this catches a broken package without
@@ -113,6 +113,14 @@ vet: deps
fmt-check:
@out=$$(gofmt -l .); if [ -n "$$out" ]; then echo "gofmt needed:"; echo "$$out"; exit 1; fi
+# Fiesta's spacing check (Paul, 2026-11-22: no ad-hoc spacing): every
+# margin, padding and gap in Calendar's own stylesheets is a
+# var(--rst-sp-N), or says why not with /* spacing-allow: why */.
+# tokens.css is rastrillo's; theme, busy, chrome, menu, sky and base
+# are estilo's, written by scripts/writeestilo: neither is ours to space.
+spacing:
+ go tool fiesta spacing -skip tokens.css -skip theme.css -skip busy.css -skip chrome.css -skip menu.css -skip sky.css -skip base.css internal/calendar/static
+
# A step of its own, not folded into another target's recipe: ci.d/
# steps each exec one make target, so migration-check needs its own
# name to get its own reported step on a runner with step support.
@@ -133,7 +141,7 @@ migration-check:
# fails the build the moment models.go and migrations/ disagree,
# instead of at boot on whatever machine notices next. If the app
# declares manifest resources, also add: rastrillo generate --check
-ci: vet fmt-check test migration-check
+ci: vet fmt-check spacing test migration-check
# The browser gate: the quick-add box driven in a real Chromium, with
# script and then with JavaScript disabled.
@@ -150,13 +158,17 @@ ci: vet fmt-check test migration-check
# that is unset. The CSP check is the one served through rastrillo's
# production stack, so it is the one that sees the real policy.
#
+# TestEveryScreenKeepsTheRhythm is Fiesta's rhythm audit over every
+# screen at 1280 and 390px, through the production stack, reading
+# around the calendar grids themselves.
+#
# TestSmartDoorInABrowser (internal/calendar) is the sign-in door in every
# state at 320px and 1280px: no sideways scroll, 24px targets, the Oficina
# glyph drawn. It forces the light scheme itself. On macOS, run with
# TMPDIR=/tmp if a unix socket path is too long.
browser:
npm install --no-save playwright
- RASTRILLO_CHROME="$(RASTRILLO_CHROME)" go test -tags browser -run 'InARealBrowser|OnTap|OnANarrowScreen|SurviveTheProductionCSP' ./internal/calendartest/
+ RASTRILLO_CHROME="$(RASTRILLO_CHROME)" go test -tags browser -run 'InARealBrowser|OnTap|OnANarrowScreen|SurviveTheProductionCSP|KeepsTheRhythm' ./internal/calendartest/
RASTRILLO_CHROME="$(RASTRILLO_CHROME)" go test -tags browser -run 'SmartDoorInABrowser' ./internal/calendar/
# The Playwright cache's Chromium: older caches hold Chromium.app, newer
diff --git a/README.md b/README.md
index 605caca..4c6e632 100644
--- a/README.md
+++ b/README.md
@@ -107,7 +107,7 @@ times each link has been polled, because a feed is not free.
## Running it
```sh
-make ci # vet, gofmt, tests, migration check — the one gate
+make ci # vet, gofmt, spacing, tests, migration check — the one gate
make release # the stripped linux/arm64 binary
```
diff --git a/go.mod b/go.mod
index da3c32b..bc8654c 100644
--- a/go.mod
+++ b/go.mod
@@ -7,14 +7,14 @@ toolchain go1.26.5
require (
amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f
amadan.net/oficina/home/handoff v0.0.0-20261122114341-150d94e2370f
- amadan.net/rastrillo/rastrillo v0.42.0
+ amadan.net/rastrillo/rastrillo v0.44.1
github.com/carlosframework/rastrillo v0.23.0
github.com/chromedp/chromedp v0.21.0
github.com/go-chi/chi/v5 v5.3.2
gorm.io/gorm v1.31.2
)
-require amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803
+require amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e
require (
github.com/BurntSushi/toml v1.6.0 // indirect
@@ -47,7 +47,7 @@ require (
)
require (
- amadan.net/rastrillo/fiesta v1.5.0 // indirect
+ amadan.net/rastrillo/fiesta v1.6.1 // indirect
amadan.net/rastrillo/rastrillo/money v0.1.0 // indirect
github.com/google/jsonschema-go v0.4.3 // indirect
github.com/modelcontextprotocol/go-sdk v1.8.0 // indirect
@@ -58,10 +58,14 @@ require (
github.com/tdewolff/parse/v2 v2.8.16 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
golang.org/x/mod v0.38.0 // indirect
+ golang.org/x/net v0.58.0 // indirect
golang.org/x/oauth2 v0.35.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.48.0 // indirect
)
-tool amadan.net/rastrillo/rastrillo/cmd/rastrillo
+tool (
+ amadan.net/rastrillo/fiesta/cmd/fiesta
+ amadan.net/rastrillo/rastrillo/cmd/rastrillo
+)
diff --git a/go.sum b/go.sum
index 4d1861c..77c4885 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
amadan.net/oficina/agent-access.git v0.0.0-20261025011012-4b94ff9e8a8d h1:bSsf1NXVhXTfLLB9J7a5v9CqzdKj8CALHZ6W3H7A/4M=
amadan.net/oficina/agent-access.git v0.0.0-20261025011012-4b94ff9e8a8d/go.mod h1:Ph9PIa3VE1IEaUzZiQH6D+IQ6HThWWGfVr0ecMMgrFA=
-amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803 h1:yl1LyYZW3/722xRPnXMu5veg4sZGjyDMJFLqOWST0ws=
-amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8=
+amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e h1:g2EvXlQAleAEFsc4yIBvS7ycMG3GyuEySEOia0yo8nY=
+amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8=
amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f h1:gnH04Aq06V9RVdv2OSdg+MqluUzsXZcnzSC+fUZ8gxg=
amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f/go.mod h1:B45bHBZF5AtFJqy4d1qSDNDOqYcNkSz1qD20TLF1DI8=
amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816 h1:AFDuOio0MxNxN9ZWVc3lul1QHkNjNUCO56kXpe/Fw3I=
@@ -12,12 +12,12 @@ amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2 h1:yKUTS0nOiVw
amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2/go.mod h1:gqshuXyDtFZUCYbhuZyV3Epc51pUcsLbpqAqiA5UiXg=
amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2 h1:0PQiRUkC+9cbTHE67Y4/SmW1sPH1NNWNwTceNFyMjTY=
amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2/go.mod h1:dXBZeB2ic33SIZiGUCzafmviUT8TYWgzSYZvo2rM6zA=
-amadan.net/rastrillo/fiesta v1.5.0 h1:wKfTsL5zRMofJBAqOxNlCY7aCtgHCtfwvTPBMA+ZA20=
-amadan.net/rastrillo/fiesta v1.5.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY=
+amadan.net/rastrillo/fiesta v1.6.1 h1:WYgHt652+uQj6eR0Y0JLin+XrdRPGk1WPW7o0lSrc94=
+amadan.net/rastrillo/fiesta v1.6.1/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY=
amadan.net/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3 h1:5EFx7BLJj/+G/rt8bTmeyMWVfF5s5Sns7ajTvX4w/I8=
amadan.net/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3/go.mod h1:ZaaxeE278dJltdrLwmwpxUjQ5wuKzqDAVSNRet+WupY=
-amadan.net/rastrillo/rastrillo v0.42.0 h1:RJ0ecpdb2kMqwW9216bBpUqzpboxLYKb/51wq/+ceyo=
-amadan.net/rastrillo/rastrillo v0.42.0/go.mod h1:0bufVMz8D4aWvxvJjehW70T8Jsvytrp1YEwoIzFTKm8=
+amadan.net/rastrillo/rastrillo v0.44.1 h1:7RNROXSmxr1m9Ax/siyPxS2DEjppIHAj/jWectdoxVQ=
+amadan.net/rastrillo/rastrillo v0.44.1/go.mod h1:0bufVMz8D4aWvxvJjehW70T8Jsvytrp1YEwoIzFTKm8=
amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM=
amadan.net/rastrillo/rastrillo/money v0.1.0/go.mod h1:cmgkjBEIQh1pFSYvQk0UU6oPYS8kSDypdT9+t4Flx0U=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
@@ -86,6 +86,8 @@ golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
+golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
+golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
diff --git a/internal/calendar/credits/notices.json b/internal/calendar/credits/notices.json
index b9fc4a6..18ff0d8 100644
--- a/internal/calendar/credits/notices.json
+++ b/internal/calendar/credits/notices.json
@@ -35,7 +35,7 @@
},
{
"Name": "amadan.net/rastrillo/fiesta",
- "Version": "v1.5.0",
+ "Version": "v1.6.1",
"SourceURL": "https://amadan.net/rastrillo/fiesta",
"Notices": [
{
@@ -46,7 +46,7 @@
},
{
"Name": "amadan.net/rastrillo/rastrillo",
- "Version": "v0.42.0",
+ "Version": "v0.44.1",
"SourceURL": "https://amadan.net/rastrillo/rastrillo",
"Notices": [
{
diff --git a/internal/calendar/static/brand/brand.css b/internal/calendar/static/brand/brand.css
index 27e25ad..475fb08 100644
--- a/internal/calendar/static/brand/brand.css
+++ b/internal/calendar/static/brand/brand.css
@@ -3,7 +3,7 @@
[estilo-brand] {
display: inline-flex;
align-items: center;
- gap: .5rem;
+ gap: var(--rst-sp-2);
min-block-size: 24px;
}
[estilo-brand-icon] {
diff --git a/internal/calendar/static/calendar.css b/internal/calendar/static/calendar.css
index 2f6bad0..7b4b263 100644
--- a/internal/calendar/static/calendar.css
+++ b/internal/calendar/static/calendar.css
@@ -112,7 +112,7 @@ html { scroll-padding-block-start: var(--estilo-bar-block-size); }
[cal-day-cell] {
display: flex;
flex-direction: column;
- gap: 2px;
+ gap: 2px; /* spacing-allow: the month grid's chips, stacked tight so a 7.5rem day holds four */
height: 100%;
padding: var(--rst-sp-1);
}
@@ -128,7 +128,7 @@ html { scroll-padding-block-start: var(--estilo-bar-block-size); }
color: var(--rst-text-muted);
display: block;
font-size: var(--rst-fs-sm);
- padding: 2px;
+ padding: 2px; /* spacing-allow: the day's number tucked into its cell's corner */
text-decoration: none;
}
@@ -149,7 +149,7 @@ html { scroll-padding-block-start: var(--estilo-bar-block-size); }
[cal-more] {
color: var(--rst-text-muted);
font-size: var(--rst-fs-xs);
- padding-inline-start: 2px;
+ padding-inline-start: 2px; /* spacing-allow: lines "+N more" up with the chips' text, past their 3px rule */
}
/* ── Chips ─────────────────────────────────────────────────────── */
@@ -168,7 +168,7 @@ html { scroll-padding-block-start: var(--estilo-bar-block-size); }
font-size: var(--rst-fs-sm);
gap: var(--rst-sp-1);
overflow: hidden;
- padding: 2px var(--rst-sp-1);
+ padding: 2px var(--rst-sp-1); /* spacing-allow: a chip is one line of small text in the month grid's dense cell */
text-decoration: none;
white-space: nowrap;
}
@@ -648,7 +648,6 @@ html { scroll-padding-block-start: var(--estilo-bar-block-size); }
display: flex;
flex-wrap: wrap;
gap: var(--rst-sp-2);
- margin-block-end: var(--rst-sp-4);
}
[cal-book-days] { list-style: none; margin: 0; padding: 0; }
diff --git a/internal/calendar/static/chrome.css b/internal/calendar/static/chrome.css
index 83a482f..95a4320 100644
--- a/internal/calendar/static/chrome.css
+++ b/internal/calendar/static/chrome.css
@@ -25,7 +25,7 @@
[estilo-bar-brand] {
display: inline-flex;
align-items: center;
- gap: 0.5rem;
+ gap: var(--rst-sp-2);
flex: none;
color: var(--rst-text);
font-weight: 650;
@@ -63,11 +63,11 @@
display: inline-flex;
align-items: center;
justify-content: center;
- gap: 0.3rem;
+ gap: var(--rst-sp-1);
box-sizing: border-box;
min-inline-size: var(--estilo-trigger-size);
block-size: var(--estilo-trigger-size);
- padding-inline: 0.4rem;
+ padding-inline: var(--rst-sp-2);
border-radius: 0; /* in-flow: square */
color: var(--rst-text-muted);
font-size: var(--rst-fs-sm);
@@ -124,7 +124,7 @@
block-size: 2rem;
inline-size: 100%;
min-inline-size: 6rem;
- padding-inline: 0.4rem;
+ padding-inline: var(--rst-sp-2);
border: 1px solid transparent;
border-radius: var(--rst-radius-sm);
background: transparent;
@@ -168,13 +168,13 @@
/* The app switcher: a float, so its tiles may be rounded. */
[estilo-switcher] { position: relative; }
[estilo-switcher-panel] { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 4px); }
-[estilo-switcher-grid] { display: grid; grid-template-columns: repeat(3, 5.5rem); gap: 0.25rem; }
+[estilo-switcher-grid] { display: grid; grid-template-columns: repeat(3, 5.5rem); gap: var(--rst-sp-1); }
[estilo-switcher-app] {
display: flex;
flex-direction: column;
align-items: center;
- gap: 0.35rem;
- padding: 0.6rem 0.25rem;
+ gap: var(--rst-sp-1);
+ padding: var(--rst-sp-2) var(--rst-sp-1);
border-radius: var(--rst-radius-sm); /* inside a float: rounded is allowed */
color: var(--rst-text);
font-size: var(--rst-fs-xs);
@@ -210,7 +210,7 @@
font-size: var(--rst-fs-xs);
font-weight: 650;
}
-[estilo-menu-identity] { display: grid; gap: 0.1rem; padding: 0.5rem var(--estilo-item-padding-inline, 0.65rem); }
+[estilo-menu-identity] { display: grid; gap: 0; padding: var(--rst-sp-2) var(--estilo-item-padding-inline, var(--rst-sp-3)); }
[estilo-menu-identity-label] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); }
[estilo-menu-identity-name] { font-weight: 600; overflow-wrap: anywhere; }
[estilo-menu-identity-address] { color: var(--rst-text-muted); overflow-wrap: anywhere; }
@@ -258,8 +258,8 @@
:root:has([estilo-door]) { overflow-x: clip; --rst-scrollbar-gutter: auto; scrollbar-gutter: auto; }
[estilo-door] {
box-sizing: border-box;
- margin-inline: calc(50% - 50vw);
- padding: max(40px, 9vh) var(--rst-sp-4) var(--rst-sp-6);
+ margin-inline: calc(50% - 50vw); /* spacing-allow: full-bleed, the door spans the viewport whatever column it sits in */
+ padding: max(var(--rst-sp-6), 9vh) var(--rst-sp-4) var(--rst-sp-6); /* spacing-allow: the card sits lower on a taller window, 9vh down */
min-block-size: 680px;
/* The whole sky lies inside the door, fading in and out, so the door's
edges never cut it: under an app's bar there is no page top to hide
@@ -270,25 +270,81 @@
--estilo-sky-top: 67px;
--estilo-sky-height: 560px;
}
+/* The card is a stack: its children's own block margins go, and the
+ space above each comes from the table Fiesta's rst-stack uses
+ (DESIGN.md, "The stack"), written here in estilo's own names because
+ an app's tokens.css may predate it:
+
+ after a heading (h1 to h6) --rst-sp-2
+ an actions row: a button, the card's
+ action or a paragraph holding it,
+ Forget (under another action:
+ --rst-sp-2) --rst-sp-4
+ an input after its label or its hint
+ ([estilo-signin-hint]), a hint after
+ its input --rst-sp-2
+ an h1 or h2, a section
+ ([estilo-signin-section]), or anything
+ after the brand, which heads the card
+ as a page header heads a page --rst-sp-5
+ an h3 to h6 --rst-sp-4
+ anything else --rst-sp-3
+
+ Higher in the table wins: each relation sets its own property on the
+ child, and the one margin rule reads them in the table's order, so
+ specificity never decides it; every child resets them first, so
+ content nested in the card never inherits an answer. A column, so
+ nothing collapses; a button or a picture keeps its own width.
+
+ As in Fiesta's stack, the column's gap is the table's smallest step
+ and a child's margin is the rest of its answer: a hidden child (or a
+ hidden input) is no flex item and takes no gap, so the block after
+ one keeps --rst-sp-2 and never touches what is above it. */
[estilo-signin] {
box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
max-inline-size: 460px;
margin: 0 auto;
- padding: 34px 40px 32px;
+ padding: var(--rst-sp-6);
+ gap: var(--rst-sp-2);
background: var(--rst-surface);
border-radius: 20px;
box-shadow: 0 0 0 1px light-dark(transparent, var(--rst-line)), var(--rst-shadow-lift);
}
-[estilo-signin] > [estilo-brand] { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }
+[estilo-signin] > * {
+ --estilo-stack-heading: initial;
+ --estilo-stack-actions: initial;
+ --estilo-stack-control: initial;
+ --estilo-stack-section: initial;
+ --estilo-stack-sub: initial;
+ margin-block: 0;
+}
+[estilo-signin] > :not([hidden], [type="hidden"]) + :not([hidden]) {
+ /* spacing-allow: the table's step less the column's --rst-sp-2 gap; margin and gap together are the step */
+ margin-block-start: calc(var(--estilo-stack-heading, var(--estilo-stack-actions, var(--estilo-stack-control, var(--estilo-stack-section, var(--estilo-stack-sub, var(--rst-sp-3)))))) - var(--rst-sp-2));
+}
+[estilo-signin] > :is(img, button, a[estilo-signin-action]) { align-self: flex-start; }
+[estilo-signin] > :not([hidden], [type="hidden"]) + :is(h3, h4, h5, h6) { --estilo-stack-sub: var(--rst-sp-4); }
+[estilo-signin] > :not([hidden], [type="hidden"]) + :is(h1, h2),
+[estilo-signin] > :not([hidden], [type="hidden"]) + [estilo-signin-section],
+[estilo-signin] > [estilo-brand] + * { --estilo-stack-section: var(--rst-sp-5); }
+[estilo-signin] > :is(label, [estilo-signin-hint]) + :is(input, select, textarea),
+[estilo-signin] > :is(input, select, textarea) + [estilo-signin-hint] { --estilo-stack-control: var(--rst-sp-2); }
+[estilo-signin] > :not([hidden], [type="hidden"]) + :is(button, [estilo-signin-action], [estilo-signin-forget], p:has(> [estilo-signin-action]), p:has(> button)) { --estilo-stack-actions: var(--rst-sp-4); }
+[estilo-signin] > :is(button, [estilo-signin-action], [estilo-signin-forget], p:has(> [estilo-signin-action]), p:has(> button)) + :is(button, [estilo-signin-action], [estilo-signin-forget], p:has(> [estilo-signin-action]), p:has(> button)) { --estilo-stack-actions: var(--rst-sp-2); }
+[estilo-signin] > :is(h1, h2, h3, h4, h5, h6) + * { --estilo-stack-heading: var(--rst-sp-2); }
+[estilo-signin] > [estilo-brand] { display: flex; align-items: center; gap: var(--rst-sp-2); font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }
[estilo-signin] > [estilo-brand] [estilo-brand-icon] { inline-size: 36px; block-size: 36px; }
-[estilo-signin] h1 { margin: 0; font-size: 1.75rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
-[estilo-signin-lede] { margin: 0.5rem 0 var(--rst-sp-4); color: var(--rst-text-muted); }
-[estilo-signin] > h1 + :not([estilo-signin-lede]) { margin-block-start: var(--rst-sp-4); }
-[estilo-signin-form] { max-inline-size: none; margin-block-start: var(--rst-sp-4); }
-[estilo-signin-body] { margin: var(--rst-sp-4) 0; }
+[estilo-signin] h1 { font-size: 1.75rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
+/* A heading the card holds directly is spaced by the stack above; one
+ nested deeper brings no margin of its own. */
+[estilo-signin] * h1 { margin: 0; }
+[estilo-signin-lede] { color: var(--rst-text-muted); }
+[estilo-signin-form] { max-inline-size: none; }
@media (max-width: 520px) {
- [estilo-door] { padding-inline: 14px; padding-block-start: 28px; }
- [estilo-signin] { padding: 26px 22px 24px; }
+ [estilo-door] { padding-inline: var(--rst-sp-4); padding-block-start: var(--rst-sp-5); }
+ [estilo-signin] { padding: var(--rst-sp-5); }
}
/* The door's links are drawn here, not left to the app: an app that does
not link base.css (Calendar, Memoria, Calls, Fichas) showed the browser's
@@ -313,7 +369,7 @@
stylesheets are linked in never decides it. */
[estilo-signin-screen] > section { display: block; inline-size: auto; max-inline-size: none; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
[estilo-signin-screen] > section > :first-child:not(:only-child):not(:has(h1)) { display: none; }
-[estilo-signin] [estilo-signin-screen] h1 { margin: 0 0 2px; font-size: 1.75rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
+[estilo-signin] [estilo-signin-screen] h1 { margin: 0; font-size: 1.75rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
/* The door's buttons are the smart door's (Paul, 2026-11-21, "yes to pill
buttons"), on every card the door draws. The card's main action is a
full-width pill, 44px tall, lit from above, its shadow tinted by its
@@ -335,7 +391,7 @@
rules give it the door's shape. A hidden button stays hidden. */
[estilo-signin] :is([estilo-signin-form] [type="submit"], [estilo-signin-action]:not([estilo-signin-action~="quiet"])):not([hidden]) {
display: flex; inline-size: 100%; box-sizing: border-box; justify-content: center; align-items: center;
- min-block-size: 44px; padding-inline: 18px; border-radius: 999px; font-weight: 600; text-decoration: none;
+ min-block-size: 44px; padding-inline: var(--rst-sp-4); border-radius: 999px; font-weight: 600; text-decoration: none;
}
/* The glow lifts the pill only at rest: pressed, rastrillo's own pressed
shadow draws it sinking. */
@@ -346,10 +402,9 @@
[estilo-signin] [estilo-signin-action~="danger"] {
--estilo-signin-glow: light-dark(color-mix(in srgb, var(--rst-danger-fill, var(--rst-tone-negative-fg)) 60%, transparent), color-mix(in srgb, var(--rst-danger-fill, var(--rst-tone-negative-fg)) 30%, transparent));
}
-[estilo-signin-forget] { margin: var(--rst-sp-2) 0 0; }
[estilo-signin] :is([estilo-signin-action~="quiet"], [estilo-signin-forget] > button):not([hidden]) {
display: flex; inline-size: fit-content; margin-inline: auto; justify-content: center; align-items: center;
- min-block-size: 2.5rem; padding: 0 0.875rem; border-color: transparent; border-radius: 999px; background: transparent; box-shadow: none;
+ min-block-size: 2.5rem; padding: 0 var(--rst-sp-3); border-color: transparent; border-radius: 999px; background: transparent; box-shadow: none;
color: var(--rst-text-muted); font-size: calc(var(--rst-fs-base) * 0.9375); font-weight: 500; text-decoration: none;
}
/* On touch, and on a narrow screen, a quiet control is a full tap target,
@@ -435,7 +490,7 @@
grid-area: menus;
align-self: stretch;
min-inline-size: 0;
- margin-inline: calc(var(--rst-sp-3) - var(--rst-sp-4)); /* the menus' edge 12px in, as Docs' own row had it */
+ margin-inline: calc(-1 * var(--rst-sp-1)); /* the menus' edge 12px in (the bar's 16px less 4px), as Docs' own row had it */
}
}
@@ -449,7 +504,7 @@
1px above that edge. */
@media (min-width: 800px) {
:root:has([estilo-bar~="stacked"]) { --estilo-bar-block-size: 56px; } /* PUBLIC */
- [estilo-bar~="stacked"] { gap: 12px; padding-inline: 12px; }
+ [estilo-bar~="stacked"] { gap: var(--rst-sp-3); padding-inline: var(--rst-sp-3); }
[estilo-bar~="stacked"] [estilo-bar-brand] img { inline-size: 32px; block-size: 32px; }
[estilo-bar~="stacked"] [estilo-bar-name] { display: none; }
[estilo-bar-stack] {
@@ -472,8 +527,8 @@
[estilo-bar~="stacked"] [estilo-bar-title-input] {
block-size: 24px;
padding-block: 0;
- margin-inline-start: calc(-0.4rem - 1px); /* the field's padding and border pulled back: the text sits on the edge */
- max-inline-size: calc(100% + 0.4rem + 1px); /* the form is that much narrower than the field: the cap gives it back */
+ margin-inline-start: calc(-1 * var(--rst-sp-2) - 1px); /* spacing-allow: the field's padding and 1px border pulled back, so its text sits on the edge */
+ max-inline-size: calc(100% + var(--rst-sp-2) + 1px); /* the form is that much narrower than the field: the cap gives it back */
font-size: 16px;
line-height: 24px;
font-weight: 600;
@@ -501,7 +556,7 @@
min-block-size: 0;
min-inline-size: 0;
margin: 0;
- padding: 0 10px;
+ padding: 0 var(--rst-sp-2);
border: 1px solid transparent;
border-radius: 999px;
background-color: var(--rst-accent-soft);
@@ -524,16 +579,16 @@
position: relative;
inset-block-start: 1px;
block-size: 20px;
- max-inline-size: calc(100% + 7px);
- margin-inline-start: -7px; /* the titles' padding pulled back: the first title's text sits on the edge */
+ max-inline-size: calc(100% + var(--rst-sp-2));
+ margin-inline-start: calc(-1 * var(--rst-sp-2)); /* the titles' padding pulled back: the first title's text sits on the edge */
}
[estilo-bar~="stacked"] [estilo-menubar] { block-size: 20px; min-block-size: 0; align-items: center; flex-wrap: nowrap; }
[estilo-bar~="stacked"] [estilo-menubar-menu] { block-size: 20px; }
[estilo-bar~="stacked"] [estilo-menubar-title] {
block-size: 24px;
min-block-size: 0;
- margin-block: -2px;
- padding-inline: 7px;
+ margin-block: -2px; /* spacing-allow: the 24px highlight overhangs the 20px row by 2px each way and takes no room */
+ padding-inline: var(--rst-sp-2);
border-radius: 6px;
color: var(--rst-text-muted);
font-size: 13px;
@@ -546,14 +601,14 @@
/* Every panel in the stacked header matches it: 28px rows, 13px type,
shortcuts muted, 4px padding and a 10px radius. */
[estilo-bar~="stacked"] [estilo-menu] {
- --estilo-float-padding: 4px;
- --estilo-item-padding-block: 4px;
- --estilo-item-padding-inline: 10px;
+ --estilo-float-padding: var(--rst-sp-1);
+ --estilo-item-padding-block: var(--rst-sp-1);
+ --estilo-item-padding-inline: var(--rst-sp-3);
border-radius: 10px;
font-size: 13px;
}
[estilo-bar~="stacked"] [estilo-menu-item] { min-block-size: 28px; border-radius: 6px; }
- [estilo-bar~="stacked"] [estilo-menu] hr { margin-block: 4px; }
+ [estilo-bar~="stacked"] [estilo-menu] hr { margin-block: var(--rst-sp-1); }
[estilo-bar~="stacked"] [estilo-menu-key] { color: var(--rst-text-muted); font-size: 12px; }
/* The controls set, in a bar with a slot: every action a 28px pill,
@@ -562,16 +617,16 @@
the person's. Lit from above as the index's New document is, and far
fainter in dark. */
:is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-end],
- :is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-actions] { gap: 8px; }
+ :is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-actions] { gap: var(--rst-sp-2); }
:is([estilo-bar-control] > a, [estilo-bar-control] > button, [estilo-bar-control] > form > button) {
display: inline-flex;
align-items: center;
- gap: 6px;
+ gap: var(--rst-sp-2);
box-sizing: border-box;
block-size: 28px;
min-block-size: 28px;
min-inline-size: 28px;
- padding: 0 12px;
+ padding: 0 var(--rst-sp-3);
border: 0;
border-radius: 999px;
background-color: transparent;
@@ -597,7 +652,7 @@
and a shadow tinted with its own accent, 0 5px 12px -5px. */
:is([estilo-bar-control~="primary"] > a, [estilo-bar-control~="primary"] > button, [estilo-bar-control~="primary"] > form > button),
:is([estilo-bar-control~="primary"] > a, [estilo-bar-control~="primary"] > button, [estilo-bar-control~="primary"] > form > button):hover:not(:disabled) {
- padding-inline: 14px;
+ padding-inline: var(--rst-sp-4);
background-color: var(--rst-accent);
color: var(--rst-on-accent);
box-shadow:
@@ -646,8 +701,8 @@
lead. Below 64rem a WideOnly action is hidden, so it does not count
there. */
:is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-end]:has(> [estilo-bar-lead], > [estilo-bar-actions] > :not([estilo-bar-control~="wide"])) > [estilo-account] {
- margin-inline-start: 4px;
- padding-inline-start: 12px;
+ margin-inline-start: var(--rst-sp-1);
+ padding-inline-start: var(--rst-sp-3);
background: linear-gradient(var(--rst-line), var(--rst-line)) left center / 1px 20px no-repeat;
}
:is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-end]:has(> [estilo-bar-lead], > [estilo-bar-actions] > :not([estilo-bar-control~="wide"])) > [estilo-account]:dir(rtl) {
@@ -696,8 +751,8 @@
}
@media (min-width: 64rem) {
:is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-end]:has(> [estilo-bar-actions]) > [estilo-account] {
- margin-inline-start: 4px;
- padding-inline-start: 12px;
+ margin-inline-start: var(--rst-sp-1);
+ padding-inline-start: var(--rst-sp-3);
background: linear-gradient(var(--rst-line), var(--rst-line)) left center / 1px 20px no-repeat;
}
:is([estilo-bar~="stacked"], [estilo-bar]:has([estilo-bar-lead])) [estilo-bar-end]:has(> [estilo-bar-actions]) > [estilo-account]:dir(rtl) {
@@ -729,9 +784,9 @@
[estilo-appearance] {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 2px;
- margin: 2px 6px 6px;
- padding: 3px;
+ gap: var(--rst-sp-1);
+ margin: var(--rst-sp-1) var(--rst-sp-2) var(--rst-sp-2);
+ padding: var(--rst-sp-1);
border-radius: 10px;
background: var(--rst-surface-2);
box-shadow: inset 0 1px 2px light-dark(rgb(23 32 60 / 0.06), rgb(0 0 0 / 0.25));
@@ -739,9 +794,9 @@
[estilo-appearance] [estilo-menu-item] {
flex-direction: column;
justify-content: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
min-block-size: 46px;
- padding: 6px 4px;
+ padding: var(--rst-sp-2) var(--rst-sp-1);
border-radius: 8px;
background: none;
color: var(--rst-text-muted);
diff --git a/internal/calendar/static/menu.css b/internal/calendar/static/menu.css
index 9070652..eb420e2 100644
--- a/internal/calendar/static/menu.css
+++ b/internal/calendar/static/menu.css
@@ -5,9 +5,9 @@
in the page flow, so it is square (the suite's square rule). */
:root {
--estilo-float-radius: 9px; /* rastrillo's hard-coded dropdown value, named. PUBLIC */
- --estilo-float-padding: 0.25rem;
- --estilo-item-padding-block: 0.4rem;
- --estilo-item-padding-inline: 0.65rem;
+ --estilo-float-padding: var(--rst-sp-1);
+ --estilo-item-padding-block: var(--rst-sp-1);
+ --estilo-item-padding-inline: var(--rst-sp-3);
}
[estilo-menu] {
box-sizing: border-box;
@@ -46,7 +46,7 @@
[estilo-menu-item] {
display: flex;
align-items: center;
- gap: 0.5rem;
+ gap: var(--rst-sp-2);
box-sizing: border-box;
inline-size: 100%;
min-block-size: 2rem;
@@ -88,7 +88,7 @@
[estilo-menu-key] {
flex: none;
margin-inline-start: auto;
- padding-inline-start: 1.5rem;
+ padding-inline-start: var(--rst-sp-5);
color: var(--rst-text-muted);
font: inherit;
font-size: var(--rst-fs-xs);
@@ -98,11 +98,11 @@
[estilo-menu] hr {
border: 0;
border-block-start: 1px solid var(--rst-line);
- margin: 0.25rem 0;
+ margin: var(--rst-sp-1) 0;
}
[estilo-menu-heading] {
margin: 0;
- padding: 0.5rem var(--estilo-item-padding-inline) 0.25rem;
+ padding: var(--rst-sp-2) var(--estilo-item-padding-inline) var(--rst-sp-1);
color: var(--rst-text-muted);
font-size: var(--rst-fs-xs);
font-weight: 600; /* no text-transform */
@@ -124,7 +124,7 @@
box-sizing: border-box;
block-size: 100%;
min-block-size: 2rem;
- padding-inline: 0.6rem;
+ padding-inline: var(--rst-sp-2);
border-radius: 0; /* square: in-flow */
color: var(--rst-text);
font-size: var(--rst-fs-sm);
diff --git a/internal/calendar/static/tokens.css b/internal/calendar/static/tokens.css
index 3ae9664..07f8b10 100644
--- a/internal/calendar/static/tokens.css
+++ b/internal/calendar/static/tokens.css
@@ -2476,6 +2476,90 @@ small.rst-field__hint, small[rst-field-hint] { display: block; font-size: var(--
and every caller writes by hand, is rst-form-bar now. */
.rst-form-foot, [rst-form-foot] { display: flex; gap: var(--rst-sp-3); margin-block-start: var(--rst-sp-3); }
+/* ── stack: a page's vertical rhythm ──────────────────────────────────
+ The blocks a screen is written in, a heading, a paragraph, a hint, a
+ card, a row of buttons, are spaced by the stack they sit in and by
+ nothing else. Hand-rolled margins gave every screen its own rhythm:
+ a heading further from its own text than from the section before
+ it, a hint resting on the button under it. So a stack is a flex
+ column, where no margin collapses, every child's own block margins
+ are zeroed, and the space before each child is read off one table
+ by what it is and what it follows (DESIGN.md, "Spacing"):
+
+ after a heading (h1 to h6) --rst-sp-2
+ before an actions row, a button --rst-sp-4
+ a label or hint, then its input, or an
+ input, then its hint --rst-sp-2
+ before h1, h2 or a section, or after
+ the page header --rst-sp-5
+ before h3 to h6 --rst-sp-4
+ anything else --rst-sp-3
+
+ Higher in the table wins. Each relation sets its own custom property
+ on the child, and the one margin rule reads them in the table's
+ order through var() fallbacks, so which rule wins is written in one
+ place rather than left to specificity. Every child resets all five
+ first, so a nested stack's child never inherits its parent's answer.
+ rst-section marks a child that opens a new section; a section that
+ holds blocks of its own is a stack too, <section rst-stack
+ rst-section>.
+
+ The column's gap is the table's smallest step, --rst-sp-2, and a
+ child's block-start margin is the rest of its answer. The gap is
+ the floor: it falls only between children that are drawn, so a
+ [hidden] child, which a sibling selector cannot see past, costs the
+ block after it its relation but never leaves it touching. A hidden
+ input, a form's CSRF field, is passed over the same way, so the
+ first block after one still opens the stack flush. */
+.rst-stack, [rst-stack] { display: flex; flex-direction: column; gap: var(--rst-sp-2); }
+.rst-stack > :not([hidden]), [rst-stack] > :not([hidden]) {
+ --rst-stack-actions: initial;
+ --rst-stack-heading: initial;
+ --rst-stack-control: initial;
+ --rst-stack-section: initial;
+ --rst-stack-sub: initial;
+ margin-block: 0;
+}
+.rst-stack > :not([hidden], [type="hidden"]) + :not([hidden]), [rst-stack] > :not([hidden], [type="hidden"]) + :not([hidden]) {
+ margin-block-start: calc(var(--rst-stack-heading, var(--rst-stack-actions, var(--rst-stack-control, var(--rst-stack-section, var(--rst-stack-sub, var(--rst-sp-3)))))) - var(--rst-sp-2));
+}
+/* A column stretches its children across; a button or a picture keeps
+ its own width. */
+.rst-stack > button, [rst-stack] > button, .rst-stack > .rst-btn, [rst-stack] > [rst-btn], .rst-stack > img, [rst-stack] > img { align-self: flex-start; }
+.rst-stack > :not([hidden], [type="hidden"]) + h3, [rst-stack] > :not([hidden], [type="hidden"]) + h3,
+.rst-stack > :not([hidden], [type="hidden"]) + h4, [rst-stack] > :not([hidden], [type="hidden"]) + h4,
+.rst-stack > :not([hidden], [type="hidden"]) + h5, [rst-stack] > :not([hidden], [type="hidden"]) + h5,
+.rst-stack > :not([hidden], [type="hidden"]) + h6, [rst-stack] > :not([hidden], [type="hidden"]) + h6 { --rst-stack-sub: var(--rst-sp-4); }
+.rst-stack > :not([hidden], [type="hidden"]) + h1, [rst-stack] > :not([hidden], [type="hidden"]) + h1,
+.rst-stack > :not([hidden], [type="hidden"]) + h2, [rst-stack] > :not([hidden], [type="hidden"]) + h2,
+.rst-stack > :not([hidden], [type="hidden"]) + .rst-section, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-section],
+.rst-stack > .rst-page-header + :not([hidden]), [rst-stack] > [rst-page-header] + :not([hidden]) { --rst-stack-section: var(--rst-sp-5); }
+.rst-stack > label + input:not([hidden]), [rst-stack] > label + input:not([hidden]),
+.rst-stack > label + select:not([hidden]), [rst-stack] > label + select:not([hidden]),
+.rst-stack > label + textarea:not([hidden]), [rst-stack] > label + textarea:not([hidden]),
+.rst-stack > .rst-field__help + input:not([hidden]), [rst-stack] > [rst-field-help] + input:not([hidden]),
+.rst-stack > .rst-field__help + select:not([hidden]), [rst-stack] > [rst-field-help] + select:not([hidden]),
+.rst-stack > .rst-field__help + textarea:not([hidden]), [rst-stack] > [rst-field-help] + textarea:not([hidden]),
+.rst-stack > input + .rst-field__help, [rst-stack] > input + [rst-field-help],
+.rst-stack > select + .rst-field__help, [rst-stack] > select + [rst-field-help],
+.rst-stack > textarea + .rst-field__help, [rst-stack] > textarea + [rst-field-help] { --rst-stack-control: var(--rst-sp-2); }
+.rst-stack > h1 + :not([hidden]), [rst-stack] > h1 + :not([hidden]),
+.rst-stack > h2 + :not([hidden]), [rst-stack] > h2 + :not([hidden]),
+.rst-stack > h3 + :not([hidden]), [rst-stack] > h3 + :not([hidden]),
+.rst-stack > h4 + :not([hidden]), [rst-stack] > h4 + :not([hidden]),
+.rst-stack > h5 + :not([hidden]), [rst-stack] > h5 + :not([hidden]),
+.rst-stack > h6 + :not([hidden]), [rst-stack] > h6 + :not([hidden]) { --rst-stack-heading: var(--rst-sp-2); }
+.rst-stack > :not([hidden], [type="hidden"]) + .rst-actions, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-actions],
+.rst-stack > :not([hidden], [type="hidden"]) + .rst-form-foot, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-form-foot],
+.rst-stack > :not([hidden], [type="hidden"]) + .rst-form-actions, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-form-actions],
+.rst-stack > :not([hidden], [type="hidden"]) + button, [rst-stack] > :not([hidden], [type="hidden"]) + button,
+.rst-stack > :not([hidden], [type="hidden"]) + .rst-btn, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-btn] { --rst-stack-actions: var(--rst-sp-4); }
+/* The actions row: buttons, links styled as buttons, and the one-button
+ forms a POST action needs, side by side and wrapping on a phone. A
+ form stays a box (display: contents would make it one no driver can
+ see), and a one-button form is as wide as its button. */
+.rst-actions, [rst-actions] { align-items: center; display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); }
+
@media (prefers-reduced-motion: reduce) {
.rst-switch__track, [rst-switch-track], .rst-switch[data-rst-settle] .rst-switch__track, [rst-switch][data-rst-settle] [rst-switch-track], .rst-tblock > .rst-tblock__head[data-rst-settle] > .rst-switch__track, [rst-tblock] > [rst-tblock-head][data-rst-settle] > [rst-switch-track] { transition: none; }
}
diff --git a/internal/calendar/templates/layout.html b/internal/calendar/templates/layout.html
index 47df9bc..d58a452 100644
--- a/internal/calendar/templates/layout.html
+++ b/internal/calendar/templates/layout.html
@@ -35,7 +35,10 @@
<div estilo-shell>
<a rst-skip href="#main">{{.Chrome.Labels.Skip}}</a>
{{template "estilo-bar" .Chrome}}
- {{block "main" .}}<main rst-page id="main">{{template "content" .}}</main>{{end}}
+ {{/* Every page but the four calendar views (which supply their own
+ <main>) is Fiesta's stack: rst-stack spaces the page's blocks,
+ its header, headings, prose, forms and buttons, by one table. */}}
+ {{block "main" .}}<main rst-page rst-stack id="main">{{template "content" .}}</main>{{end}}
<footer rst-shell-foot>{{block "foot" .}}{{end}}</footer>
</div>
</body>
diff --git a/internal/calendartest/rhythm_browser_test.go b/internal/calendartest/rhythm_browser_test.go
new file mode 100644
index 0000000..4143237
--- /dev/null
+++ b/internal/calendartest/rhythm_browser_test.go
@@ -0,0 +1,140 @@
+//go:build browser
+
+package calendartest
+
+import (
+ "context"
+ "io"
+ "log/slog"
+ "net/http"
+ "path/filepath"
+ "regexp"
+ "testing"
+ "time"
+
+ "amadan.net/rastrillo/fiesta/check/rhythm"
+ "amadan.net/rastrillo/rastrillo"
+ "amadan.net/rastrillo/rastrillo/harness"
+ "github.com/chromedp/chromedp"
+
+ calendar "amadan.net/oficina/calendar/internal/calendar"
+)
+
+// TestEveryScreenKeepsTheRhythm: each of Calendar's own screens, read by
+// Fiesta's rhythm audit (Paul, 2026-11-22: "Can we somehow put
+// something in place to avoid weird spacing issues like this in
+// future?"), served through the production stack. Every gap between
+// two of a page's blocks is a step of the spacing scale, no text rests
+// on a control, and every heading sits closer to its own content than
+// to what comes before it, at a desktop width and a phone's.
+//
+// The audit reads around the calendar grids themselves (the month's
+// table, the day's and week's columns of hours), whose cells are
+// drawn to the clock and the calendar, not to the page's rhythm.
+func TestEveryScreenKeepsTheRhythm(t *testing.T) {
+ var app *calendar.App
+ rig := harness.New(t, func(origin string) http.Handler {
+ a, err := calendar.New(calendar.Config{
+ DBPath: filepath.Join(t.TempDir(), "calendar.db"),
+ Env: "development",
+ Origin: origin,
+ Logger: slog.New(slog.NewTextHandler(io.Discard, nil)),
+ })
+ if err != nil {
+ t.Fatalf("calendar.New: %v", err)
+ }
+ t.Cleanup(func() { a.Close() })
+ app = a
+ h, closeFn, err := rastrillo.Handler(a.ServeOptions(rastrillo.Options{Logger: slog.New(slog.NewTextHandler(io.Discard, nil))}))
+ if err != nil {
+ t.Fatalf("rastrillo.Handler: %v", err)
+ }
+ if closeFn != nil {
+ t.Cleanup(func() { _ = closeFn() })
+ }
+ return h
+ })
+ session := signInOverHTTP(t, app, rig.Origin, "host@example.com")
+
+ // A published booking page, so the stranger's side has a page to
+ // draw and the host's list has a row.
+ ctx := context.Background()
+ st := app.StoreForTest()
+ host := app.PersonByAddressForTest(t, "host@example.com")
+ if err := st.SaveHandle(ctx, host.ID, "paul"); err != nil {
+ t.Fatal(err)
+ }
+ ws, _ := calendar.ParseAvailability("every day 9-5")
+ page, err := st.CreateBookingPage(ctx, host.ID, calendar.BookingPageInput{
+ Title: "Quick chat", Description: "Half an hour.", Availability: "every day 9-5",
+ DurationMin: 30, HorizonDays: 30}, ws)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := st.PublishBookingPage(ctx, host.ID, page.ID, true); err != nil {
+ t.Fatal(err)
+ }
+
+ run := func(what string, actions ...chromedp.Action[chromedp.Void]) {
+ t.Helper()
+ c, cancel := context.WithTimeout(rig.Context(), 30*time.Second)
+ defer cancel()
+ if err := chromedp.Do(c, actions...); err != nil {
+ t.Fatalf("%s: %v", what, err)
+ }
+ }
+ // Each screen is loaded once, at a desktop width, and read there and
+ // again at a phone's.
+ grids := []string{"[cal-month]", "[cal-grid]", "[cal-week-scroll]"}
+ audit := func(name, path, ready string) {
+ t.Helper()
+ for i, width := range []int64{1280, 390} {
+ var found []rhythm.Finding
+ actions := []chromedp.Action[chromedp.Void]{deviceMetrics(width, 900)}
+ if i == 0 {
+ actions = append(actions, chromedp.Navigate(rig.Origin+path))
+ }
+ actions = append(actions,
+ chromedp.WaitVisible(chromedp.CSS(ready)),
+ evalInto(&found, rhythm.Expression("main", rhythm.Options{Skip: grids})))
+ run(name, actions...)
+ if len(found) > 0 {
+ t.Errorf("%s at %dpx: %s", name, width, rhythm.Report(found))
+ }
+ }
+ }
+
+ audit("the sign-in door", "/signin", `input[name="address"]`)
+
+ run("sign in", setCookie(rig.Origin, session))
+
+ var at string
+ run("create an event",
+ chromedp.Navigate(rig.Origin+"/events/new?start=2026-09-02T09:30&end=2026-09-02T10:00"),
+ chromedp.WaitVisible(chromedp.CSS(`input[name="title"]`)),
+ chromedp.SendKeys(chromedp.CSS(`input[name="title"]`), "Standup"),
+ chromedp.Click(chromedp.CSS(`form[action="/events"] button[type="submit"]`)),
+ chromedp.WaitVisible(chromedp.CSS(`form[action$="/reminders"]`)),
+ harness.Into(&at, chromedp.Location()),
+ )
+ event := regexp.MustCompile(`/events/\d+`).FindString(at)
+ if event == "" {
+ t.Fatalf("creating an event landed on %s", at)
+ }
+
+ for _, view := range []string{"/day/2026-09-02", "/week/2026-09-02", "/month/2026-09", "/agenda?from=2026-09-02"} {
+ audit(view, view, `main`)
+ }
+ audit("a new event", "/events/new", `input[name="title"]`)
+ audit("editing an event", event+"/edit", `input[name="title"]`)
+ audit("an event", event, `form[action$="/reminders"]`)
+ audit("deleting an event", event+"/delete", `main form`)
+ audit("settings", "/settings", `main form`)
+ audit("reminders", "/reminders", `main`)
+ audit("calendars", "/calendars", `main`)
+ audit("sharing a calendar", "/calendars/1/share", `main`)
+ audit("import", "/import", `main form`)
+ audit("booking pages", "/settings/booking", `main`)
+ audit("a new booking page", "/settings/booking/new", `main form`)
+ audit("the booking page", "/book/paul/"+page.Code+"?zone=UTC", `select[name="zone"]`)
+}