Door card: hint and section hooks, and the gap floor past hidden children
The two Lows GPT-6 Astra left on feat/stack-rhythm (round 2, APPROVE), which the coordinator asked fixed before rollout goes on: - A hint or a section an app puts straight in its card got 12px. The card now takes estilo-signin-hint (0.5rem from its input, either side) and estilo-signin-section (1.5rem above it), in the table's order; AGENTS.md names them. - A hidden child after a heading turned the heading's 8px into 12px. As in Fiesta's stack, the card's column gap is the table's smallest step and a child's margin is the rest of its answer, so a hidden child (or a hidden input) takes no gap and leaves the block after it --rst-sp-2 from what is above; the relation selectors pass over hidden siblings. The margin rule's calc carries a spacing-allow (the step less the gap; with the gap it is the step). - The open-card fixture holds a hint either side of an input, a hidden block after a heading and a section; each new assertion fails on main's CSS. The gap measurer skips hidden siblings. main's chrome.css hash moves for the door's rules only. The coordinator ruled these two Lows fix-before-landing with no further review needed (Astra's round 2 on feat/stack-rhythm was APPROVE). make test, make test-spacing and the door's rhythm drive (Chromium 1255 and WebKit) pass; hub CI green at 7c75f56. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from fix/door-stack-lows into main.
5 files changed,
+56
−26
AGENTS.md+4 −1chrome/chrome.css+23 −11chrome/rhythm.browser.mjs+2 −1chrome/rhythm_browser_test.go+22 −11chrome/unchanged_test.go+5 −2
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.013s ok amadan.net/oficina/estilo.git/callui 0.009s ok amadan.net/oficina/estilo.git/chrome 1.016s ? amadan.net/oficina/estilo.git/cmd/oficina-notices [no test files] ok amadan.net/oficina/estilo.git/colophon 0.025s ok amadan.net/oficina/estilo.git/credits 0.010s ok amadan.net/oficina/estilo.git/credits/catalog 0.004s ok amadan.net/oficina/estilo.git/desk 0.005s ok amadan.net/oficina/estilo.git/googleimport 0.170s ok amadan.net/oficina/estilo.git/homeconnect 0.007s 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.010s ok amadan.net/oficina/estilo.git/savestatus 0.115s ok amadan.net/oficina/estilo.git/side 0.136s ok amadan.net/oficina/estilo.git/sky 0.030s ok amadan.net/oficina/estilo.git/theme 0.013s === spacing === go run amadan.net/rastrillo/fiesta/cmd/fiesta@v1.6.0 spacing .
diff --git a/AGENTS.md b/AGENTS.md| index d3f6e27..9d2f690 100644 |
| --- a/AGENTS.md |
| +++ b/AGENTS.md |
| @@ -295,7 +295,10 @@ Inherited from rastrillo's gates, and not negotiable downward: |
| check, run with `go run` at a version so estilo never requires Fiesta) |
| is a CI step. Blocks follow Fiesta's stack table (its DESIGN.md, "The |
| stack"), written in estilo's own rules, because an app's `tokens.css` |
| - may predate `rst-stack`: the door's card is one. |
| + may predate `rst-stack`: the door's card is one. An app's own card |
| + (`estilo-door-open`) marks a field's hint `estilo-signin-hint` (0.5rem |
| + from its input, either side) and a section of its own |
| + `estilo-signin-section` (1.5rem above it). |
| --- |
diff --git a/chrome/chrome.css b/chrome/chrome.css| index 3f6b956..95a4320 100644 |
| --- a/chrome/chrome.css |
| +++ b/chrome/chrome.css |
| @@ -280,10 +280,13 @@ |
| action or a paragraph holding it, |
| Forget (under another action: |
| --rst-sp-2) --rst-sp-4 |
| - an input after its label --rst-sp-2 |
| - an h1 or h2, or anything after the brand, |
| - which heads the card as a page header |
| - heads a page --rst-sp-5 |
| + 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 |
| @@ -291,7 +294,12 @@ |
| 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. */ |
| + 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; |
| @@ -299,6 +307,7 @@ |
| max-inline-size: 460px; |
| margin: 0 auto; |
| 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); |
| @@ -311,15 +320,18 @@ |
| --estilo-stack-sub: initial; |
| margin-block: 0; |
| } |
| -[estilo-signin] > * + * { |
| - margin-block-start: var(--estilo-stack-heading, var(--estilo-stack-actions, var(--estilo-stack-control, var(--estilo-stack-section, var(--estilo-stack-sub, var(--rst-sp-3)))))); |
| +[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] > * + :is(h3, h4, h5, h6) { --estilo-stack-sub: var(--rst-sp-4); } |
| -[estilo-signin] > * + :is(h1, h2), |
| +[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] > label + :is(input, select, textarea) { --estilo-stack-control: var(--rst-sp-2); } |
| -[estilo-signin] > * + :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(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; } |
diff --git a/chrome/rhythm.browser.mjs b/chrome/rhythm.browser.mjs| index 9c15656..c9d7c95 100644 |
| --- a/chrome/rhythm.browser.mjs |
| +++ b/chrome/rhythm.browser.mjs |
| @@ -39,7 +39,8 @@ for (const engine of job.engines) { |
| })), job.sizes || []) |
| const gaps = await page.evaluate((sels) => Object.fromEntries(sels.map((s) => { |
| const el = document.querySelector(s) |
| - const prev = el && el.previousElementSibling |
| + let prev = el && el.previousElementSibling |
| + while (prev && prev.getClientRects().length === 0) prev = prev.previousElementSibling |
| return [s, prev ? el.getBoundingClientRect().top - prev.getBoundingClientRect().bottom : null] |
| })), job.gaps || []) |
| result.pages.push({ page: name, viewport, findings, sizes, gaps }) |
diff --git a/chrome/rhythm_browser_test.go b/chrome/rhythm_browser_test.go| index 0892776..cd95bf3 100644 |
| --- a/chrome/rhythm_browser_test.go |
| +++ b/chrome/rhythm_browser_test.go |
| @@ -75,26 +75,37 @@ func openCard(t *testing.T) string { |
| <label id="g-label" for="door-name">Your name</label> |
| <input id="g-input" type="text"> |
| <p id="g-hint">Shown to your team.</p> |
| + <p id="g-field-hint" estilo-signin-hint>Your work address.</p> |
| + <input id="g-hinted" type="email" aria-label="Email"> |
| + <p id="g-after-hint" estilo-signin-hint>We never show it to anyone outside the team.</p> |
| <h3 id="g-h3">Notifications</h3> |
| + <p id="g-hidden" hidden>Hidden.</p> |
| + <p id="g-past-hidden">After a hidden block, still close to its heading.</p> |
| <img id="door-img" src="/dot.svg" alt=""> |
| <p id="g-after-img">We'll email you when someone invites you.</p> |
| - <button id="door-button" type="button">Join</button>` |
| + <button id="door-button" type="button">Join</button> |
| + <section id="g-section" estilo-signin-section><p>A section of the card's own.</p></section>` |
| return open + body + render(t, "estilo-door-close", nil) |
| } |
| // openGaps is the table, in the open card: the space above each block, |
| // in CSS pixels at a 16px root. |
| var openGaps = map[string]float64{ |
| - "#g-h1": 24, // after the brand |
| - "#g-lede": 8, // after a heading |
| - "#g-h2": 24, // before an h2 |
| - "#g-label": 8, // after a heading |
| - "#g-input": 8, // an input after its label |
| - "#g-hint": 12, // anything else |
| - "#g-h3": 16, // before an h3 |
| - "#door-img": 8, // after a heading |
| - "#g-after-img": 12, // anything else |
| - "#door-button": 16, // before a button |
| + "#g-h1": 24, // after the brand |
| + "#g-lede": 8, // after a heading |
| + "#g-h2": 24, // before an h2 |
| + "#g-label": 8, // after a heading |
| + "#g-input": 8, // an input after its label |
| + "#g-hint": 12, // anything else |
| + "#g-field-hint": 12, // anything else |
| + "#g-hinted": 8, // an input after its hint |
| + "#g-after-hint": 8, // a hint after its input |
| + "#g-h3": 16, // before an h3 |
| + "#g-past-hidden": 8, // after a heading, past a hidden block: the gap |
| + "#g-section": 24, // a section |
| + "#door-img": 12, // anything else |
| + "#g-after-img": 12, // anything else |
| + "#door-button": 16, // before a button |
| } |
| func openGapNames() []string { |
diff --git a/chrome/unchanged_test.go b/chrome/unchanged_test.go| index 46b6e42..5adf381 100644 |
| --- a/chrome/unchanged_test.go |
| +++ b/chrome/unchanged_test.go |
| @@ -84,9 +84,12 @@ const barStackMarker = "\n/* ── Bar stack" |
| // stack. The bar and its menus move by a pixel or two (the trigger's |
| // padding 0.4rem to 0.5rem, a menu row's 0.4rem to 0.25rem and 0.65rem |
| // to 0.75rem), and nothing else in their rules changed; the door's card |
| -// became a stack, its rules all keyed on estilo-signin. |
| +// became a stack, its rules all keyed on estilo-signin. chrome.css's |
| +// again on fix/door-stack-lows, for the door's card only: its gap is the |
| +// table's smallest step as in Fiesta's stack, so a hidden child leaves no |
| +// relation touching, and the card takes a hint and a section hook. |
| const ( |
| - mainChromeCSS = "97baefd498e9339c39a07e0ace6cbd1d7cc3cc5a326804ce673ebf0e6af1dbcd" |
| + mainChromeCSS = "14fbea040b3ab0fba3b4d47c01889915887ad7b164a454154ca6ab790d5a3a14" |
| mainMenuCSS = "90defb24148756958619c1e96db2bb2bc663f92b4acbb19ea94f9e037ecbab63" |
| ) |