chrome: pill buttons on every door card (Paul, 2026-11-21)
Paul: "yes to pill buttons". On a door card ([estilo-signin]) the main action is a full-width pill, lit at rest and sinking when pressed: the classic sign-in form's submit, and anything carrying the new estilo-signin-action hook. Danger is a red pill. Quiet controls (estilo-signin-action="quiet", and Forget) are text buttons over a soft pill, 44px on touch. The one-way smart door keeps Fiesta's own pills (a test holds it). The sent card's back link is now quiet. Keyed on estilo's own hooks; no rst- selectors. Reviewed by Claude Fable: APPROVE AFTER FIXES, fixes in 7153f7b. CI passed. Discussion 41. Fichas and Mapa add the hooks at their next estilo bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from feat/door-pills into main.
6 files changed,
+114
−19
chrome/chrome.css+46 −7chrome/chrome_test.go+2 −2chrome/door_test.go+2 −2chrome/screen_test.go+56 −2chrome/templates/signin.html+4 −3chrome/unchanged_test.go+4 −3
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.009s ok amadan.net/oficina/estilo.git/callui 0.009s ok amadan.net/oficina/estilo.git/chrome 4.625s ? amadan.net/oficina/estilo.git/cmd/oficina-notices [no test files] ok amadan.net/oficina/estilo.git/colophon 0.022s ok amadan.net/oficina/estilo.git/credits 0.006s 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 3.271s ok amadan.net/oficina/estilo.git/homeconnect 0.004s 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.109s ok amadan.net/oficina/estilo.git/side 0.132s ok amadan.net/oficina/estilo.git/sky 0.031s ok amadan.net/oficina/estilo.git/theme 0.012s
diff --git a/chrome/chrome.css b/chrome/chrome.css| index e6aa01b..83a482f 100644 |
| --- a/chrome/chrome.css |
| +++ b/chrome/chrome.css |
| @@ -314,14 +314,53 @@ |
| [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; } |
| -/* Signed out: "Forget me on this device", a quiet text button under Sign |
| - in, drawn as the smart door's small controls are (medium weight, the |
| - muted ink that darkens on hover, a touch smaller than body text, a soft |
| - pill on hover and focus). Pulled back by its own padding so its words |
| - line up with the card's text above. */ |
| +/* 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 |
| + fill: the accent's, or red for a danger button. Its secondary controls |
| + are quiet text buttons, centred under it: medium weight, the muted ink |
| + that darkens over a soft pill on hover and focus, a touch smaller than |
| + body text. rastrillo's one-way door already draws its own buttons this |
| + way; nothing here reaches it. |
| + |
| + Keyed on estilo's hooks, never on rastrillo's button attributes, which |
| + are rastrillo's to style (AGENTS.md, Vocabulary; internal/lint): |
| + - a door sign-in form's submit ([estilo-signin-form]) is its main |
| + action, so the classic form and every app's confirm step are pills; |
| + - [estilo-signin-action] marks any other main action on the card, and |
| + [estilo-signin-action~="danger"] a destructive one; |
| + - [estilo-signin-action~="quiet"] marks a secondary control, as the |
| + signed-out page's Forget ([estilo-signin-forget]) is. |
| + The button keeps its rastrillo variant for its fill and states; these |
| + 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; |
| +} |
| +/* The glow lifts the pill only at rest: pressed, rastrillo's own pressed |
| + shadow draws it sinking. */ |
| +[estilo-signin] :is([estilo-signin-form] [type="submit"], [estilo-signin-action]:not([estilo-signin-action~="quiet"])):not([hidden]):not(:active) { |
| + box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 1px rgb(23 32 60 / 0.10), |
| + 0 8px 18px -8px var(--estilo-signin-glow, light-dark(color-mix(in srgb, var(--rst-accent-fill, var(--rst-accent)) 80%, transparent), color-mix(in srgb, var(--rst-accent-fill, var(--rst-accent)) 30%, transparent))); |
| +} |
| +[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-forget] > button { margin-inline-start: -0.875rem; min-block-size: 2.5rem; padding: 0 0.875rem; 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; } |
| -[estilo-signin-forget] > button:hover, [estilo-signin-forget] > button:focus-visible { background: var(--rst-surface-2); color: var(--rst-text); } |
| +[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; |
| + 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, |
| + as rastrillo's door draws its ghost (max(2.5rem, --rst-target), which is |
| + 2.75rem there). Restated rather than read: estilo's pinned rastrillo |
| + does not declare --rst-target, and every token chrome.css reads must be |
| + declared by the pin (TestChromeUsesDefinedTokens). */ |
| +@media (pointer: coarse), (max-width: 40rem) { |
| + [estilo-signin] :is([estilo-signin-action~="quiet"], [estilo-signin-forget] > button):not([hidden]) { min-block-size: 2.75rem; } |
| +} |
| +[estilo-signin] :is([estilo-signin-action~="quiet"], [estilo-signin-forget] > button):is(:hover, :focus-visible) { background: var(--rst-ghost-face-hover, var(--rst-surface-2)); color: var(--rst-text); } |
| /* ── Bar stack (Docs' I2 editor header, spec 2026-11-11) ──────────────── |
| Everything below is opt-in. Each rule is keyed on a hook only a bar |
diff --git a/chrome/chrome_test.go b/chrome/chrome_test.go| index c7c126e..357b54d 100644 |
| --- a/chrome/chrome_test.go |
| +++ b/chrome/chrome_test.go |
| @@ -329,11 +329,11 @@ func TestSignInPages(t *testing.T) { |
| } |
| } |
| html = render(t, "estilo-signin-sent", SignInNotice{Icon: "/i.svg", Heading: label + "-sent", Body: label + "-body", Link: &Link{Href: "/signin", Label: label + "-again"}}) |
| - if !strings.Contains(html, esc(label)+"-sent") || !strings.Contains(html, `<a href="/signin">`+esc(label)+"-again") { |
| + if !strings.Contains(html, esc(label)+"-sent") || !strings.Contains(html, `<a rst-btn="ghost" estilo-signin-action="quiet" href="/signin">`+esc(label)+"-again") { |
| t.Fatal("sent page", html) |
| } |
| html = render(t, "estilo-signed-out", SignInNotice{Icon: "/i.svg", Heading: label + "-out", Body: label + "-body", Link: &Link{Href: "/signin", Label: label + "-in"}}) |
| - if !strings.Contains(html, `<a rst-btn="primary" href="/signin">`+esc(label)+"-in") { |
| + if !strings.Contains(html, `<a rst-btn="primary" estilo-signin-action href="/signin">`+esc(label)+"-in") { |
| t.Fatal("signed-out page", html) |
| } |
| }) |
diff --git a/chrome/door_test.go b/chrome/door_test.go| index 8c8d452..3924719 100644 |
| --- a/chrome/door_test.go |
| +++ b/chrome/door_test.go |
| @@ -85,7 +85,7 @@ func TestTheDoorDrawsItsOwnCopy(t *testing.T) { |
| for _, want := range []string{ |
| "<h1>Check your email</h1>", |
| `<p estilo-signin-body role="status">If that address can sign in here, we’ve sent it a link. It works once and expires in 15 minutes.</p>`, |
| - `<a href="/signin?return_to=%2Fm%2Fabc">Use a different address</a>`, |
| + `<a rst-btn="ghost" estilo-signin-action="quiet" href="/signin?return_to=%2Fm%2Fabc">Use a different address</a>`, |
| } { |
| if !strings.Contains(html, want) { |
| t.Errorf("sent lacks %q:\n%s", want, html) |
| @@ -96,7 +96,7 @@ func TestTheDoorDrawsItsOwnCopy(t *testing.T) { |
| for _, want := range []string{ |
| "<h1>You’re signed out</h1>", |
| "<p estilo-signin-body>You’ve signed out of Calls on this device.</p>", |
| - `<a rst-btn="primary" href="/signin">Sign in</a>`, |
| + `<a rst-btn="primary" estilo-signin-action href="/signin">Sign in</a>`, |
| } { |
| if !strings.Contains(html, want) { |
| t.Errorf("signed-out lacks %q:\n%s", want, html) |
diff --git a/chrome/screen_test.go b/chrome/screen_test.go| index 2c4ff4d..a791e54 100644 |
| --- a/chrome/screen_test.go |
| +++ b/chrome/screen_test.go |
| @@ -172,7 +172,7 @@ func TestOficinaGlyph(t *testing.T) { |
| func TestSignedOutOffersForget(t *testing.T) { |
| n := SignInNotice{Icon: "/i.svg", App: "Docs"}.SignedOut("/signin").Forgetting("/auth/forget", "/d/abc", Hidden{"csrf", "tok"}) |
| html := render(t, "estilo-signed-out", n) |
| - want := ` <p><a rst-btn="primary" href="/signin">Sign in</a></p> |
| + want := ` <p><a rst-btn="primary" estilo-signin-action href="/signin">Sign in</a></p> |
| <form estilo-signin-forget method="post" action="/auth/forget"> |
| <input type="hidden" name="return_to" value="/d/abc"> |
| <input type="hidden" name="csrf" value="tok"> |
| @@ -196,11 +196,65 @@ func TestSignedOutOffersForget(t *testing.T) { |
| } |
| // Its look is the door's quiet control, and keys only on its own hook. |
| src := string(CSS()) |
| - if !strings.Contains(src, "[estilo-signin-forget] > button {") || !strings.Contains(src, "color: var(--rst-text-muted); font-size: calc(var(--rst-fs-base) * 0.9375); font-weight: 500; }") { |
| + if !strings.Contains(src, "[estilo-signin] :is([estilo-signin-action~=\"quiet\"], [estilo-signin-forget] > button):not([hidden]) {") || !strings.Contains(src, "color: var(--rst-text-muted); font-size: calc(var(--rst-fs-base) * 0.9375); font-weight: 500;") { |
| t.Error("chrome.css does not draw Forget as a quiet text button") |
| } |
| } |
| +// Every card the door draws has pill buttons (Paul, 2026-11-21, "yes to |
| +// pill buttons"): the main action a full-width pill, secondary controls |
| +// quiet text buttons. chrome.css reaches them by estilo's hooks only, so |
| +// estilo's own cards must carry them, and the smart door's partial, which |
| +// rastrillo already draws as pills, must carry none. |
| +func TestTheDoorsButtonsArePills(t *testing.T) { |
| + src := string(CSS()) |
| + for _, want := range []string{ |
| + `[estilo-signin] :is([estilo-signin-form] [type="submit"], [estilo-signin-action]:not([estilo-signin-action~="quiet"])):not([hidden]) {`, |
| + "min-block-size: 44px; padding-inline: 18px; border-radius: 999px; font-weight: 600;", |
| + "inset 0 1px 0 rgb(255 255 255 / 0.22)", |
| + `[estilo-signin] [estilo-signin-action~="danger"] {`, |
| + "--estilo-signin-glow: light-dark(color-mix(in srgb, var(--rst-danger-fill", |
| + } { |
| + if !strings.Contains(src, want) { |
| + t.Errorf("chrome.css lacks %q", want) |
| + } |
| + } |
| + // The classic form's one submit is the form's main action. |
| + form := render(t, "estilo-signin", SignIn{Icon: "/i.svg", Action: "/signin"}) |
| + if !regexp.MustCompile(`(?s)<form rst-form estilo-signin-form .*<button rst-btn="primary" type="submit">Sign in</button>.*</form>`).MatchString(form) { |
| + t.Errorf("the sign-in form's submit is not where the pill rule looks for it:\n%s", form) |
| + } |
| + if n := strings.Count(form, `type="submit"`); n != 1 { |
| + t.Errorf("the sign-in form has %d submits; the pill rule makes each one the main action", n) |
| + } |
| + // Signed out: Sign in is the main action, Forget the quiet one. |
| + out := render(t, "estilo-signed-out", SignInNotice{Icon: "/i.svg", App: "Docs"}.SignedOut("/signin").Forgetting("/auth/forget", "")) |
| + for _, want := range []string{`<a rst-btn="primary" estilo-signin-action href="/signin">`, "<form estilo-signin-forget"} { |
| + if !strings.Contains(out, want) { |
| + t.Errorf("signed-out lacks %q:\n%s", want, out) |
| + } |
| + } |
| + // Sent: Use a different address is the card's quiet secondary action. |
| + sent := render(t, "estilo-signin-sent", SignInNotice{Icon: "/i.svg", App: "Docs"}.Sent("/signin")) |
| + if !strings.Contains(sent, `<a rst-btn="ghost" estilo-signin-action="quiet" href="/signin">`) { |
| + t.Errorf("sent's way back is not a quiet button:\n%s", sent) |
| + } |
| + // Quiet controls keep the touch target; pressing a pill drops its glow, |
| + // so rastrillo's pressed state still sinks. |
| + for _, want := range []string{"@media (pointer: coarse), (max-width: 40rem) {\n [estilo-signin] :is([estilo-signin-action~=\"quiet\"], [estilo-signin-forget] > button):not([hidden]) { min-block-size: 2.75rem; }", `:not([hidden]):not(:active) {`} { |
| + if !strings.Contains(src, want) { |
| + t.Errorf("chrome.css lacks %q", want) |
| + } |
| + } |
| + // The smart door's buttons are rastrillo's: no estilo hook reaches them. |
| + screen := renderScreen(t, "estilo-signin-screen", docsScreen(standInState{})) |
| + for _, hook := range []string{"estilo-signin-action", "estilo-signin-form", "estilo-signin-forget"} { |
| + if strings.Contains(screen, hook) { |
| + t.Errorf("the smart door carries %s, so estilo's pill rules would restyle rastrillo's buttons:\n%s", hook, screen) |
| + } |
| + } |
| +} |
| + |
| // A copy set that leaves Forget empty still draws a named button: the |
| // label falls back to English's at render time. |
| func TestForgetIsNeverUnnamed(t *testing.T) { |
diff --git a/chrome/templates/signin.html b/chrome/templates/signin.html| index a89fc4d..8bb4a2d 100644 |
| --- a/chrome/templates/signin.html |
| +++ b/chrome/templates/signin.html |
| @@ -77,12 +77,13 @@ |
| {{define "estilo-signin-screen-title"}}{{with .State}}{{if not .Unavailable}}{{template "signin-title" (dict "State" $.State "Brand" (dict "Name" $.App) "L" $.L)}}{{end}}{{end}}{{end}} |
| {{/* estilo-signin-sent: replaces the form once a link has been sent. Link |
| - goes back to the form, keeping the return. Data: chrome.SignInNotice. */}} |
| + goes back to the form, keeping the return: a quiet text button, the |
| + card's secondary action. Data: chrome.SignInNotice. */}} |
| {{define "estilo-signin-sent"}}{{template "estilo-door-open" .}} |
| <h1>{{.Heading}}</h1> |
| <p estilo-signin-body role="status">{{.Body}}</p> |
| {{- with .Link}} |
| - <p><a href="{{.Href}}">{{.Label}}</a></p> |
| + <p><a rst-btn="ghost" estilo-signin-action="quiet" href="{{.Href}}">{{.Label}}</a></p> |
| {{- end}} |
| {{template "estilo-door-close"}}{{end}} |
| @@ -94,7 +95,7 @@ |
| <h1>{{.Heading}}</h1> |
| <p estilo-signin-body>{{.Body}}</p> |
| {{- with .Link}} |
| - <p><a rst-btn="primary" href="{{.Href}}">{{.Label}}</a></p> |
| + <p><a rst-btn="primary" estilo-signin-action href="{{.Href}}">{{.Label}}</a></p> |
| {{- end}} |
| {{- with .Forget}} |
| <form estilo-signin-forget method="post" action="{{.Action}}"> |
diff --git a/chrome/unchanged_test.go b/chrome/unchanged_test.go| index 6a86205..4be4221 100644 |
| --- a/chrome/unchanged_test.go |
| +++ b/chrome/unchanged_test.go |
| @@ -76,10 +76,11 @@ const barStackMarker = "\n/* ── Bar stack" |
| // app is a design decision: make it deliberately, and update these with |
| // the reason in the commit. chrome.css's was last updated on |
| // feat/smart-door, for the door's rules only (the footer slot removed; |
| -// the smart door and the signed-out page's Forget added): no bar rule |
| -// changed. |
| +// the smart door and the signed-out page's Forget added), and again on |
| +// feat/door-pills, for the door's rules only (the door's buttons drawn as |
| +// pills, Paul 2026-11-21): no bar rule changed. |
| const ( |
| - mainChromeCSS = "7191f4df53e675cc6920eb9efd84393e68e696c4ee8fae818bbb56c058ed1cfb" |
| + mainChromeCSS = "d3fd4b3440932c3d797be502bfe6d1e450ecd21b26d5d3913069e8368446d29e" |
| mainMenuCSS = "6b3435a18591d20ad62b40df3e64e159b501f9d1c183b2f42aa32b4faa9c0669" |
| ) |