Review

Skip offscreen chapbook cards with content-visibility

Ridgeline Press's seasonal chapbook grid paints every cover when editors scroll the spring list on a tablet. Apply content-visibility: auto so the browser can skip rendering offscreen cards, pair it with contain-intrinsic-size so the scrollbar and Tab order stay stable, and keep titles in the accessibility tree (auto, not hidden).

CSSTier 1cssperformancecontent-visibility

Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.

src/catalog/ChapbookCard.module.css+4-1
11.card {
22 display: flex;
33 flex-direction: column;
44 gap: 0.75rem;
55 padding: 1rem;
66 border: 1px solid var(--ink-150);
77 border-radius: 0.75rem;
88 background: var(--paper);
9- /* full paint on every card — janks past ~80 rows */
9+ /* skip paint/layout for offscreen cards; keep a11y + find-in-page */
10+ content-visibility: auto;
11+ /* size placeholder until first paint; auto remembers last height */
12+ contain-intrinsic-size: auto 320px;
1013}
1114
1215.cover {
1316 aspect-ratio: 2 / 3;
1417 object-fit: cover;
1518 border-radius: 0.5rem;
1619 background: var(--ink-50);
1720}
1821
1922.title {
2023 font: 600 1rem/1.3 var(--serif);
2124 color: var(--ink-900);
2225}
2326
2427.card:focus-within {
2528 outline: 2px solid var(--brand-500);
2629 outline-offset: 2px;
2730}