Front page and id.*'s door on the spacing scale
Paul, 2026-11-22: "Can we somehow put something in place to avoid weird spacing issues like this in future?", then "Release and start the rollout". Fiesta 1.6.0's rhythm audit read 16 off-scale gaps on oficina.works (18 on a phone) and 22px between the door's brand and its heading on id.oficina.works. - home.css declares Fiesta's six steps (the front page links no tokens.css; TestTheFrontPagesScaleIsFiestas holds them to the vendored tokens.css), and the gaps between the page's blocks take them: headline 24, lead 40, picture 40, h2 to text 16, the cards' lines 12, the download note 16, TestFlight 40 then 8 and 12, a phone's stacked columns 40. - estilo 6238a47: id.*'s door card is a stack on the scale. - Fiesta 1.6.0 pinned: tokens.css re-copied (the stack rules only), credits regenerated. - TestTheFrontPageKeepsTheRhythm and TestTheDoorKeepsTheRhythm run the audit at 1280 and 390px; each fails on main's CSS or estilo. Review: GPT-6 Astra (Fable at its weekly limit), APPROVE AFTER FIXES, no code defects; the fixes were this repo's gates: discussion 147 is the review record, and the canary (canary/overnight-home) served 1b0ad55 and then eed8ff6 (X-Carlos-Version checked on both hosts), audited clean in light and dark at desktop and phone, then put back on v0.1.0-181-ge6a1573. Hub CI green at eed8ff6. Not deployed to production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from fix/landing-rhythm into main.
7 files changed,
+233
−19
go.mod+2 −2go.sum+4 −0internal/home/credits/notices.json+1 −1internal/home/landing_rhythm_browser_test.go+80 −0internal/home/page_test.go+32 −0internal/home/static/site/home.css+30 −16internal/home/static/tokens.css+84 −0
CI cancelled — superseded by a newer push — run details
CI log
amadan: .amadan/timeout: this job's budget is 20m0s (this runner allows up to 30m0s) === vet === CGO_ENABLED=0 go vet ./... CGO_ENABLED=0 go vet -tags browser ./internal/home/ cd handoff && CGO_ENABLED=0 go vet ./... cd roster && CGO_ENABLED=0 go vet ./... cd dashboard && CGO_ENABLED=0 go vet ./... cd connect && CGO_ENABLED=0 go vet ./... cd teammode && CGO_ENABLED=0 go vet ./... === fmt === === build === CGO_ENABLED=0 go build ./... CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/home ./cmd/oficina ./internal/operatorlaunch cd handoff && CGO_ENABLED=0 go build ./... cd roster && CGO_ENABLED=0 go build ./... cd dashboard && CGO_ENABLED=0 go build ./... cd connect && CGO_ENABLED=0 go build ./... cd teammode && CGO_ENABLED=0 go build ./... === go-test === CGO_ENABLED=0 go test -count=1 ./... ? amadan.net/oficina/home/cmd/home [no test files] ok amadan.net/oficina/home/cmd/home-placeholder 0.998s ? amadan.net/oficina/home/cmd/oficina [no test files] ok amadan.net/oficina/home/internal/guardstest 0.417s ok amadan.net/oficina/home/internal/home 56.653s ok amadan.net/oficina/home/internal/home/directorydata 1.356s ok amadan.net/oficina/home/internal/home/logtest 0.004s ok amadan.net/oficina/home/internal/home/seal 0.003s ok amadan.net/oficina/home/internal/home/sealtest 0.003s ok amadan.net/oficina/home/internal/home/wisp 0.044s ok amadan.net/oficina/home/internal/operator 6.467s ok amadan.net/oficina/home/internal/operatorlaunch 4.114s ok amadan.net/oficina/home/internal/provisioner 48.746s cd handoff && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/handoff 0.662s ok amadan.net/oficina/home/handoff/seal 0.002s cd roster && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/roster 5.123s cd dashboard && CGO_ENABLED=0 go test ./... ok amadan.net/oficina/home/dashboard 0.010s cd connect && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/connect 1.397s ok amadan.net/oficina/home/connect/linkstore 0.419s cd teammode && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/teammode 0.098s ? amadan.net/oficina/home/teammode/teammodetest [no test files] === race === go test -race -count=1 ./internal/home/ ./internal/operator/ ./internal/operatorlaunch/ ./internal/home/directorydata/ ok amadan.net/oficina/home/internal/home 334.768s ok amadan.net/oficina/home/internal/operator 82.451s ok amadan.net/oficina/home/internal/operatorlaunch 22.388s ok amadan.net/oficina/home/internal/home/directorydata 23.486s amadan: job cancelled — a newer push superseded it
landed from fix/landing-rhythm
diff --git a/go.mod b/go.mod| index e6b7326..810bc9c 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -5,7 +5,7 @@ go 1.26.0 |
| toolchain go1.26.5 |
| require ( |
| - amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803 |
| + amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e |
| amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816 |
| amadan.net/oficina/home/handoff v0.0.0-20261120140933-17cdcaff3345 |
| amadan.net/oficina/home/roster v0.0.0-20261028165624-d942439ac4e4 |
| @@ -24,7 +24,7 @@ require ( |
| ) |
| require ( |
| - amadan.net/rastrillo/fiesta v1.5.0 // indirect |
| + amadan.net/rastrillo/fiesta v1.6.0 // indirect |
| amadan.net/rastrillo/rastrillo/money v0.1.0 // indirect |
| github.com/BurntSushi/toml v1.6.0 // indirect |
| github.com/carlosframework/rastrillo v0.23.0 // indirect |
diff --git a/go.sum b/go.sum| index e6b78eb..dbc4063 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -4,6 +4,8 @@ amadan.net/oficina/estilo.git v0.0.0-20261121231010-7153f7b05452 h1:zEhZxMM/9GiU |
| amadan.net/oficina/estilo.git v0.0.0-20261121231010-7153f7b05452/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8= |
| 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/dashboard v0.0.0-20261024234842-3774eb68f816 h1:AFDuOio0MxNxN9ZWVc3lul1QHkNjNUCO56kXpe/Fw3I= |
| amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816/go.mod h1:+7xsX+QyVFrKy5gDAGh+FZ5+75z4CibWTL0wl9DWAw0= |
| amadan.net/oficina/home/handoff v0.0.0-20261120140933-17cdcaff3345 h1:3fR/a8Mqiwsnhv7Cu6FFzVHVtdqRTxyl1EpXeL6IaV0= |
| @@ -12,6 +14,8 @@ amadan.net/oficina/home/roster v0.0.0-20261028165624-d942439ac4e4 h1:jg3sS7hy8Qa |
| amadan.net/oficina/home/roster v0.0.0-20261028165624-d942439ac4e4/go.mod h1:gqshuXyDtFZUCYbhuZyV3Epc51pUcsLbpqAqiA5UiXg= |
| 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.0 h1:ntdiZ/rvKd8wVxnlwkbaB8n0Fop9tIFL7bgJ3MUN3E4= |
| +amadan.net/rastrillo/fiesta v1.6.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| amadan.net/rastrillo/rastrillo v0.38.0 h1:q8aPnVtKt4q+uNjfxBRCTizhVvj+HdjDJh1MhlkBPOc= |
| amadan.net/rastrillo/rastrillo v0.38.0/go.mod h1:0bufVMz8D4aWvxvJjehW70T8Jsvytrp1YEwoIzFTKm8= |
| amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM= |
diff --git a/internal/home/credits/notices.json b/internal/home/credits/notices.json| index 0151193..729ae93 100644 |
| --- a/internal/home/credits/notices.json |
| +++ b/internal/home/credits/notices.json |
| @@ -46,7 +46,7 @@ |
| }, |
| { |
| "Name": "amadan.net/rastrillo/fiesta", |
| - "Version": "v1.5.0", |
| + "Version": "v1.6.0", |
| "SourceURL": "https://amadan.net/rastrillo/fiesta", |
| "Notices": [ |
| { |
diff --git a/internal/home/landing_rhythm_browser_test.go b/internal/home/landing_rhythm_browser_test.go| new file mode 100644 |
| index 0000000..8005a75 |
| --- /dev/null |
| +++ b/internal/home/landing_rhythm_browser_test.go |
| @@ -0,0 +1,80 @@ |
| +//go:build browser |
| + |
| +package home |
| + |
| +import ( |
| + "context" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/rastrillo/fiesta/check/rhythm" |
| + "amadan.net/rastrillo/rastrillo/harness" |
| + "github.com/chromedp/chromedp" |
| +) |
| + |
| +// TestTheFrontPageKeepsTheRhythm: oficina.works, signed out, 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?"). Every gap between two of the 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 product picture under the headline (.stage) |
| +// is a drawing of the apps, spaced as they are, so the audit reads |
| +// around it, as it reads around the wisps' drawing. |
| +func TestTheFrontPageKeepsTheRhythm(t *testing.T) { |
| + f := newMountedChooser(t) |
| + useChrome(t) |
| + rig := harness.New(t, asHost(directoryHost, f.p.directory.Router())) |
| + for _, width := range []int64{1280, 390} { |
| + ctx, cancel := context.WithTimeout(rig.Context(), 30*time.Second) |
| + var found []rhythm.Finding |
| + var step string |
| + err := chromedp.Do(ctx, |
| + chromedp.EmulateViewport(width, 900), |
| + chromedp.Navigate(rig.Origin+"/"), |
| + chromedp.WaitVisible(chromedp.CSS(`main`)), |
| + harness.Into(&step, chromedp.Evaluate[string]( |
| + `getComputedStyle(document.documentElement).getPropertyValue("--rst-sp-2").trim()`)), |
| + harness.Into(&found, chromedp.Evaluate[[]rhythm.Finding]( |
| + rhythm.Expression("main", rhythm.Options{Skip: []string{".stage", ".wisp-defs"}})))) |
| + cancel() |
| + if err != nil { |
| + t.Fatalf("at %dpx: %v", width, err) |
| + } |
| + // A step the page never declares is no margin at all, and every |
| + // gap it sets reads as 0, which is on the scale. |
| + if step != "0.5rem" { |
| + t.Fatalf("at %dpx: --rst-sp-2 is %q on the front page, want 0.5rem", width, step) |
| + } |
| + if len(found) > 0 { |
| + t.Errorf("at %dpx: %s", width, rhythm.Report(found)) |
| + } |
| + } |
| +} |
| + |
| +// TestTheDoorKeepsTheRhythm: id.*'s sign-in door is estilo's card |
| +// (chrome.css, served from the pinned estilo), read by the same audit. |
| +// It had 22px between the brand and the way in; estilo's card is now a |
| +// stack on the scale. |
| +func TestTheDoorKeepsTheRhythm(t *testing.T) { |
| + f := newMountedChooser(t) |
| + useChrome(t) |
| + rig := harness.New(t, asHost(credentialHost, f.p.credential.Router())) |
| + for _, width := range []int64{1280, 390} { |
| + ctx, cancel := context.WithTimeout(rig.Context(), 30*time.Second) |
| + var found []rhythm.Finding |
| + err := chromedp.Do(ctx, |
| + chromedp.EmulateViewport(width, 900), |
| + chromedp.Navigate(rig.Origin+"/signin"), |
| + chromedp.WaitVisible(chromedp.CSS(`[estilo-signin]`)), |
| + harness.Into(&found, chromedp.Evaluate[[]rhythm.Finding]( |
| + rhythm.Expression("main", rhythm.Options{})))) |
| + cancel() |
| + if err != nil { |
| + t.Fatalf("at %dpx: %v", width, err) |
| + } |
| + if len(found) > 0 { |
| + t.Errorf("at %dpx: %s", width, rhythm.Report(found)) |
| + } |
| + } |
| +} |
diff --git a/internal/home/page_test.go b/internal/home/page_test.go| index 3e72921..83bb145 100644 |
| --- a/internal/home/page_test.go |
| +++ b/internal/home/page_test.go |
| @@ -3,7 +3,9 @@ package home |
| import ( |
| "bytes" |
| "html" |
| + "os" |
| "regexp" |
| + "strings" |
| "testing" |
| "amadan.net/oficina/estilo.git/sky" |
| @@ -43,3 +45,33 @@ func TestFrontPageRendersEstilosSky(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// TestTheFrontPagesScaleIsFiestas: the front page links no tokens.css, |
| +// so home.css states the spacing scale itself; it must be the scale the |
| +// vendored tokens.css carries, step for step, or the page drifts from |
| +// every other page the suite draws. |
| +func TestTheFrontPagesScaleIsFiestas(t *testing.T) { |
| + step := regexp.MustCompile(`--rst-sp-([1-6]):\s*([^;]+);`) |
| + read := func(css []byte) map[string]string { |
| + out := map[string]string{} |
| + for _, m := range step.FindAllSubmatch(css, -1) { |
| + if _, seen := out[string(m[1])]; !seen { |
| + out[string(m[1])] = strings.TrimSpace(string(m[2])) |
| + } |
| + } |
| + return out |
| + } |
| + tokens, err := os.ReadFile("static/tokens.css") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + want, got := read(tokens), read(siteAsset("home.css")) |
| + if len(want) != 6 { |
| + t.Fatalf("read %d steps from tokens.css, want 6", len(want)) |
| + } |
| + for n, v := range want { |
| + if got[n] != v { |
| + t.Errorf("home.css --rst-sp-%s is %q, tokens.css says %q", n, got[n], v) |
| + } |
| + } |
| +} |
diff --git a/internal/home/static/site/home.css b/internal/home/static/site/home.css| index 090ab72..8711e28 100644 |
| --- a/internal/home/static/site/home.css |
| +++ b/internal/home/static/site/home.css |
| @@ -8,6 +8,20 @@ |
| seeded as the suite's own. Light and dark follow the reader's system; |
| the page runs no script to switch them. */ |
| +/* The spacing scale. The front page links no tokens.css, so it states |
| + Fiesta's six steps itself, and page_test.go holds them to the |
| + vendored tokens.css. Every margin, gap and padding between the page's |
| + blocks is one of them (Fiesta's rhythm audit reads the page in |
| + landing_rhythm_browser_test.go). */ |
| +:root { |
| + --rst-sp-1: 0.25rem; |
| + --rst-sp-2: 0.5rem; |
| + --rst-sp-3: 0.75rem; |
| + --rst-sp-4: 1rem; |
| + --rst-sp-5: 1.5rem; |
| + --rst-sp-6: 2.5rem; |
| +} |
| + |
| *, *::before, *::after { box-sizing: border-box; } |
| body { |
| margin: 0; |
| @@ -52,14 +66,14 @@ h1, h2, h3 { text-wrap: balance; } |
| .hero { --estilo-sky-top: -10%; --estilo-sky-height: 74%; } |
| .hero-in { text-align: center; padding-block: 72px 0; } |
| .hero-h { |
| - margin: 0 auto 22px; max-width: 13ch; |
| + margin: 0 auto var(--rst-sp-5); max-width: 13ch; |
| font: 620 clamp(44px, 7.2vw, 78px)/1.02 var(--rst-font); letter-spacing: -0.035em; |
| } |
| -.hero-lead { margin: 0 auto 32px; max-width: 46ch; color: var(--rst-text-muted); font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.55; } |
| -.acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; } |
| +.hero-lead { margin: 0 auto var(--rst-sp-6); max-width: 46ch; color: var(--rst-text-muted); font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.55; } |
| +.acts { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); justify-content: center; } |
| .stage { |
| - position: relative; height: 470px; margin-top: 60px; |
| + position: relative; height: 470px; margin-top: var(--rst-sp-6); |
| border-radius: 24px 24px 0 0; overflow: hidden; |
| background: color-mix(in oklab, var(--rst-accent) 7%, var(--rst-surface-2)); |
| } |
| @@ -91,9 +105,9 @@ h1, h2, h3 { text-wrap: balance; } |
| /* ── Bands ── */ |
| .band { padding-block: 92px; } |
| .band-quiet { background: var(--rst-surface); border-block: 1px solid var(--rst-line); } |
| -.band h2, .sec-head h2 { margin: 0 0 14px; font: 620 clamp(28px, 3.4vw, 40px)/1.1 var(--rst-font); letter-spacing: -0.03em; } |
| -.sec-head { max-width: 60ch; margin-bottom: 40px; } |
| -.prose { margin: 0 0 16px; max-width: 58ch; color: var(--rst-text-muted); font-size: 17px; line-height: 1.65; } |
| +.band h2, .sec-head h2 { margin: 0 0 var(--rst-sp-4); font: 620 clamp(28px, 3.4vw, 40px)/1.1 var(--rst-font); letter-spacing: -0.03em; } |
| +.sec-head { max-width: 60ch; margin-bottom: var(--rst-sp-6); } |
| +.prose { margin: 0 0 var(--rst-sp-4); max-width: 58ch; color: var(--rst-text-muted); font-size: 17px; line-height: 1.65; } |
| .prose.sm { font-size: 15px; } |
| .lnk { font-weight: 600; } |
| .two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; align-items: start; } |
| @@ -123,11 +137,11 @@ h1, h2, h3 { text-wrap: balance; } |
| /* ── Memoria's answer, and the sign-in card ── */ |
| .ask { padding: 24px 28px; border-radius: 18px; background: var(--rst-bg); box-shadow: 0 0 0 1px var(--rst-line); } |
| .band:not(.band-quiet) .ask { background: var(--rst-surface); } |
| -.ask-q { margin: 0 0 10px; font: 620 17px/1.35 var(--rst-font); } |
| -.ask-a { margin: 0 0 14px; color: var(--rst-text-muted); } |
| +.ask-q { margin: 0 0 var(--rst-sp-3); font: 620 17px/1.35 var(--rst-font); } |
| +.ask-a { margin: 0 0 var(--rst-sp-3); color: var(--rst-text-muted); } |
| .ask-cite { margin: 0; font-size: 14px; } |
| .ask-cite a { font-weight: 600; text-decoration: none; } |
| -.ask-note { margin: 12px 0 0; color: var(--rst-text-faint); font-size: 14px; } |
| +.ask-note { margin: var(--rst-sp-3) 0 0; color: var(--rst-text-faint); font-size: 14px; } |
| /* ── Isolation ── */ |
| .facts { display: grid; gap: 12px; margin: 0; } |
| @@ -141,10 +155,10 @@ h1, h2, h3 { text-wrap: balance; } |
| .dl-list li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 12px; padding: 18px; border-radius: 18px; background: var(--rst-bg); box-shadow: 0 0 0 1px var(--rst-line); } |
| .dl-app { font-weight: 620; } |
| .dl-list .btn { grid-column: 1 / -1; } |
| -.dl-req { margin: 20px 0 0; max-width: 60ch; color: var(--rst-text-faint); font-size: 14px; } |
| -.tf { margin-top: 44px; max-width: 62ch; } |
| -.tf h3 { margin: 0 0 10px; font: 620 20px/1.25 var(--rst-font); letter-spacing: -0.015em; } |
| -.tf p { margin: 0 0 10px; color: var(--rst-text-muted); } |
| +.dl-req { margin: var(--rst-sp-4) 0 0; max-width: 60ch; color: var(--rst-text-faint); font-size: 14px; } |
| +.tf { margin-top: var(--rst-sp-6); max-width: 62ch; } |
| +.tf h3 { margin: 0 0 var(--rst-sp-2); font: 620 20px/1.25 var(--rst-font); letter-spacing: -0.015em; } |
| +.tf p { margin: 0 0 var(--rst-sp-3); color: var(--rst-text-muted); } |
| /* ── Footer ── */ |
| .foot { padding-block: 56px 64px; border-top: 1px solid var(--rst-line); background: var(--rst-surface); } |
| @@ -164,14 +178,14 @@ h1, h2, h3 { text-wrap: balance; } |
| .launch { position: static; width: auto; } |
| .doc { position: static; width: auto; height: 250px; margin-top: 14px; border-radius: 16px 16px 0 0; } |
| .doc-page { padding: 18px 22px; } |
| - .two { grid-template-columns: 1fr; gap: 32px; } |
| + .two { grid-template-columns: 1fr; gap: var(--rst-sp-6); } |
| .foot-in { grid-template-columns: 1fr 1fr; gap: 32px; } |
| } |
| @media (max-width: 640px) { |
| .shell { padding-inline: 20px; } |
| .nav { display: none; } |
| .hero-in { padding-top: 44px; } |
| - .stage { margin-top: 40px; } |
| + .stage { margin-top: var(--rst-sp-6); } |
| .band { padding-block: 64px; } |
| .family { grid-template-columns: 1fr; } |
| .launch-apps li { padding: 10px 4px; } |
diff --git a/internal/home/static/tokens.css b/internal/home/static/tokens.css| index 3ae9664..07f8b10 100644 |
| --- a/internal/home/static/tokens.css |
| +++ b/internal/home/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; } |
| } |