Card

The generic content card primitive — used for index grids, related-content tiles, and the base of more specialised card types.

≈ 2 min read 305 words Updated 2026-11-21

On this page

.card is Bifrost’s generic card primitive — a bordered, rounded, lightly shadowed block with hover lift. It’s the visual foundation for most index grids and related-content tiles across the site.

Source: themes/bifrost/sass/components/_card.scss

Anatomy#

TokenValue
Backgroundvar(--color-card-bg)
Border1px solid var(--color-border)
Radius0.75rem
Padding1.5rem
Shadow0 1px 3px rgba(0,0,0,0.1) + 0 1px 2px rgba(0,0,0,0.06)
HovertranslateY(-2px), deeper shadow, border --color-border-strong.
ElementWhat
.card__headerOptional. Bottom-padded, hairline border underneath.
.card__titleTitle-row text.
.card__bodyMain content.
.card__footerMeta row at the bottom.

When NOT to use this#

For premium / lead cards (lead Article on /articles/, lead Dispatch on /news/, reading-path tiles on /read/) use glass-cloud-card instead. The generic .card is for index tiles and uniform grids where prominence is spread evenly.

Summary length#

Article cards, including the lead card, prefer extra.card_summary, then description, then extra.summary. Prefer one or two concise sentences that tell readers what the article examines. Full abstracts remain on the article itself. Card summaries are visually limited to four lines.

The October 2026 consistency pass added dedicated summaries to the 28 English Explainers. Translated cards use their own localized description unless a localized extra.card_summary is supplied.

Library descriptions are no longer cut at an arbitrary character count. Their complete text remains in the markup; normal cards show up to four lines and featured cards up to three. This avoids stored excerpts ending mid-word, while the book page provides the full description.

Live examples#

Edit this page on GitHub