AI analysis Two side-by-side photo masonry cards compare layout recalculation cost while a width slider resizes the grid.
Two rounded cards sit side by side on a light off-white background, each followed by a per-frame timing metric and a code block in a comparison layout. Each card header combines a small circular thumbnail, a bold sans-serif title, and a gray pill count badge, while the metrics and code use a monospace face with red, blue, and purple syntax highlighting. The card body is a masonry grid of warm-toned interior photos stacked as rounded tiles, and dragging the floating width slider panel at the bottom switches between three and four columns while the lower edge fades out. Failure and success are distinguished by a gray X icon label and a blue check icon label, making it a useful reference for responsive masonry components and performance comparison demo screens.
minimal · light-mode · techy
claude-opus-5-5 · 2026-12-03 07:00 · Confidence 0.75
Original post Design Engineering Tip:
Don't read and write layout in the same loop.
Every offsetHeight you read after changing a style makes the browser redo the whole layout. In a masonry grid that's one layout per item, and 160ms per frame.
Read all heights first, then set all styles. One layout, 4ms.
const hs = items. map((el) => el.offsetHeight)
items.forEach((el, i) => {
el. style.gridRowEnd = span(hs[i])
})
235 likes · 8 reposts
x.com/gabriell_lab/status/2124867210258563232