Page MenuHomePhabricator

Image Browsing: Define a CSS Grid "masonry" layout for Visual TOC Items on larger screens
Closed, DuplicatePublic

Description

(@JScherer-WMF please add a relevant illustration to this task)

Per T402964, the Visual Table of Contents component will switch to a 2-column layout on larger viewports (above 640px wide). This grid is not a series of equal-height rows – instead, the design calls for 2 columns where variable-height items can be stacked in an alternating pattern. Breaking out of a strict boxy pattern is the design goal, and we are explicitly embracing the fact that items will have varying height depending on the amount of text that accompanies a given image here.

In order to achieve this effect, we probably want to rely on CSS Grid to define a grid with two vertical "tracks", where items of varying height can be added. Maybe this is possible with Flexbox as well. Ideally the solution is achievable in pure CSS.

Event Timeline

I have some objections to the vertical masonry layout on 'I like straightforward ordering of things' reasons :D

However it should be fairly straightforward to implement with modern CSS grid (we'd use float/clear back in the day, but that's icky). If we're game to go this way, let's make it pretty. :)

egardner triaged this task as High priority.Sep 2 2025, 4:15 PM

I thought we'd need a separate task for this but it's handled in T402964 now.