From 327cb63b0028c1f537ec38dd3527e83d2b3c61dc Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Tue, 2 Jun 2026 09:22:11 -0400 Subject: [PATCH] =?UTF-8?q?css:=20.row=20style=20guide=20+=20conditional?= =?UTF-8?q?=20templates=20=E2=80=94=20fix=20'log=20out'=20breaking=20+=20n?= =?UTF-8?q?ote=20overlap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous .row rule unconditionally pinned column 2 at 1fr, which stretched whichever child happened to land there. On the screenshot that meant the 'log out' button got stretched and wrapped its label across two lines, and the trailing note overlapped buttons it was supposed to describe. New rules (now also documented in CLAUDE.md as a style guide so future authoring is consistent): - default .row: grid-auto-columns: max-content (everything packs at its natural width, no stretch) - :has(> :first-child + input/select): template 'auto 1fr', input grows - :has(> input/select:first-child): template '1fr', input fills, rest pack - .row > .note: auto-drops to its own line under the buttons/inputs via grid-column: 1 / -1 - .row > label: white-space: normal, so long checkbox labels wrap Applied to zebra-spaces, chat, zebra-audio. CLAUDE.md "Web style guide — form-row patterns" table lists every supported shape so new rows reuse the primitive instead of inventing custom layouts. --- CLAUDE.md | 34 ++++++++++++++++++++++++++++++++++ web/chat.html | 23 +++++++++++++++++++---- web/zebra-audio.html | 23 +++++++++++++++++++---- web/zebra-spaces.html | 39 ++++++++++++++++++++++++++++++--------- 4 files changed, 102 insertions(+), 17 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 5c830d6..d711adf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -165,6 +165,40 @@ If you need a one-off horizontal alignment of two short inline things (e.g. a label + a value), grid still works fine (`grid-template-columns: auto 1fr`). Don't reach for flex. +### Web style guide — form-row patterns + +`.row` is the single primitive for every horizontal form strip in every +zebra page. Don't invent new wrappers. CSS auto-detects the row shape via +`:has()` and picks the right grid template. + +Supported row shapes (DOM order matters): + +| Shape | Template applied | Use when | +|---|---|---| +| `