Skip to content
Toolkit

ADR-0059 — The variant that wins is the one with a stylesheet

  • Status: Accepted
  • Date: 2026-08-24
  • Deciders: Repository owner, track 003 phase 02 (d)
  • Follows: ADR-0055 (the render spec is a crosswalk), ADR-0057 (the render path is Cardsite's React; the label is served)

Context

Five Cardsite arms map to the kit's featured-link. Three of them — big_link, featured_link, cta — were one card under three names and migrated together as phase 02 (d)'s third slice, on a banner variant. Two did not, because they each drew their own card:

  • external_item composed its card out of layout utilities: an anchor around div.row-md, a thumb is-xl, a p.medium title, a p.small dim line, and a price in a trailing span.strong.section-title.
  • linkedin_profile drew the same object out of a named idiom: bl-card bl-card--row with bl-card__title and bl-card__desc, a thumb is-lg, and no price.

Both are a mark, a title over a supporting line, and — for one of them — a figure at the end. One kind, one kit type, two markups. Converging them means choosing which markup the shared variant draws, and that choice is not obvious from the arms: neither is wrong, and each is what its author reached for.

The remaining phase 02 (d) work is full of this shape. video, link, paypal, instagram_feed and rss_feed all share a migrated kind's kit type while drawing something the kind does not, and each will need the same call. A rule beats five coin tosses.

Decision

When arms converge on one kind, the variant adopts the named idiom over the ad-hoc composition — the markup that has a stylesheet of its own, not the one assembled from utility classes at the call site.

Here that is bl-card: apps/web/src/styles/blocks.css gives it a block layout, a row modifier, and __title, __desc, __meta and __figure slots, and four other arms already draw with it. external_item's trailing price lands in __figure, the slot the family already provides for exactly that; linkedin_profile draws what it always drew.

Three corollaries, which are the parts that generalise:

  1. A variant is a drawing, not a compromise. The banner variant keeps its utility composition — it is a different drawing, not a worse version of this one. A kind may speak two dialects across two variants; it may not speak two within one.
  2. Differences of content become bindings. The LinkedIn card's 'LinkedIn' default and its headline in the description's place are descriptor business. The component learns nothing about either arm.
  3. Differences the kit has no prop for stay presentation. The kit's featured-link carries a click count, not a figure, so the price is read from settings like the coupon's image and the booking widget's cover, and the gap rides the upstream feed (ADR-0031) rather than being patched into the snapshot.

Consequences

  • external_item's card changes: its title, line and price take the bl-card family's type, and its mark takes the row card's is-lg size. Same content, same order, one idiom.
  • linkedin_profile's card does not change at all.
  • Both now require a destination to draw, where external_item used to render an anchor with an empty href. With nowhere to go the kind declines and the generic fallback has no link to make either, so the block is absent — which is what linkedin_profile's own if (!href) return null already did.
  • The bl-card__* classes stop being one arm's private markup and become the row-card idiom, which is what the next converging slice will reach for.
  • One more colour of the "which markup wins" question is settled without an ADR each time: the answer is in the stylesheet.

Source: docs/decisions/0059-the-variant-that-wins-is-the-one-with-a-stylesheet.md

Library