About CSS Grid Playground
Spanning is where grids earn their keep and where hand-written CSS goes wrong. Click a cell to widen it across columns and the generated rule updates; switch auto-flow to dense and later items backfill the gaps a span leaves, which is the behaviour a photo wall or a dashboard actually wants. Gaps are set separately for rows and columns because they are rarely equal in a real layout.
Set the column count, the row and column gaps, the auto-flow and the item placement with the controls, and the preview lays out a real CSS grid with those values. Each cell is a button: clicking it widens the item across two, three or four columns and then back to one, and the generated stylesheet adds a grid-column: span rule for every item that is wider than a single track. The Tailwind pane shows the equivalent utility classes for the container.
The interesting control is grid-auto-flow. With the default row flow, an item that spans two columns can leave a hole at the end of the previous row, because the next item will not fit there and moves down. Switch to dense and the browser fills that hole with the next item that does fit, reordering the visual layout to close gaps. It is the behaviour a photo gallery or a dashboard of mixed-size cards wants, and the one that surprises people when reading order and visual order stop matching.
Column and row gaps get their own sliders — cards in a row usually sit closer to each other than to the row above them. When the two values match, the generated CSS collapses them into the single-value gap shorthand; when they differ it writes the two-value form, and the Tailwind output uses gap-x and gap-y accordingly.
Columns are written as repeat(n, minmax(0, 1fr)) rather than plain 1fr tracks. The minmax matters: a bare 1fr track has a minimum size of auto, which means a long word or a wide image inside a cell can push the track wider than its share and break the equal-column promise. With a zero minimum the columns stay equal and the content inside them is what has to yield.