Rows the grid makes for you in CSS
You size the columns; the rows keep arriving whether you planned them or not.
.gallery {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(8rem, auto);
grid-auto-flow: row dense;
gap: 1rem;
}
.gallery .wide { grid-column: span 2; }
.gallery .tall { grid-row: span 2; }
.sidebar-layout {
display: grid;
grid-auto-flow: column;
grid-auto-columns: minmax(12rem, 1fr);
}
How it works
grid-auto-rowssizes every row the grid creates implicitly.grid-auto-flow: densebackfills holes, at the cost of source order.minmax()withautolets a row grow past its floor.
Keywords and builtins used here
displaygallerygapgridminmaxremrepeattallwide
The run, in numbers
- Lines
- 16
- Characters to type
- 317
- Tokens
- 83
- Three-star pace
- 80 tpm
At the three-star pace of 80 tokens a minute, this run takes about 62 seconds.
Step 6 of 7 in Grid, step 12 of 24 in Flexbox & grid.