Skip to content
SprecherEast
Issue 678

bug: Key fact cards do not line up when a title wraps to two lines

Back to our plan
Done
bugfrontendstylinguxpriority: medium

Problem

In short: in a row of fact cards, when one card's title wraps onto two lines, its big value ("Pending") drops a line below the values in the other cards ("Decided", "Nov 10"). The row looks uneven. The owner wants rows like this to stay symmetric.

Summary of the owner's feedback (2026-11-04, Claude in Chrome side panel, on "The short version" cards in "A new way onto I-94 at Milwaukee Street"): where a line break would otherwise appear, either change the text so it fits or, as the cards shrink, switch to stacked cards instead of cards on one line, before any line break is created.

Details

  • The three cards come from the key facts block (src/platform/richtext/editorial/KeyFacts.tsx and FactCard.tsx). Each card is its own flex column, so a title that wraps ("Who pays for the ramps") pushes only that card's value down.
  • The fix has to hold for any text an editor writes, not only this post.

Proposed fix

Native first, then ours:

  1. CSS subgrid (native): let the cards in a row share their rows, so titles, values, details and badges line up across the cards even when one title wraps. Check browser support and the repo's CardGrid before writing anything custom.
  2. Stack before it breaks: when the row can't fit its titles on one line each, switch the whole block to one card per row (a container query on the block, so it reacts to the space the block has, not the screen).
  3. Shorter text: the block's editor guidance and limits (keyFactsBlockConfig.ts) suggest short titles, and the review checks them at several widths.

Decide between 1 and 2 at grooming and record why on this issue.

Acceptance criteria

  • Not done: At 320, 430, 768, 1024, 1280 and 1920 px, in light and dark, the values in a row of cards sit on one line, or the cards are stacked one per row. A row with uneven values never appears.
  • Not done: Checked with a long title, a two-line title and a short title in the same row.
  • Not done: Tests first for the layout rule; an axe check still passes.
  • Not done: Screenshots at the six widths are on the PR.

Area

frontend, ux, styling

Priority

medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab