Grid's ultimate moves: 7 levels of subgrid, implicit vs explicit grids and dense packing. An advanced CSS Grid game for designers of complex layouts.
repeat(count, pattern) repeats a column or row pattern. repeat(3, 1fr) is three equal columns, shorter than writing 1fr 1fr 1fr.
minmax(min, max) gives a column its smallest and largest size. Inside repeat(), columns can grow with the space without ever going below their minimum.
auto-fill inside repeat() makes as many columns as fit. The number of columns changes as the container widens or narrows, with no media query.
grid-template-areas lays out the grid with area names you can read like a picture. Each element goes into its area with grid-area: name.
grid-auto-flow: dense changes how the grid places plots. Small plots may move back to fill a gap a large plot left; without dense, the gap stays empty.
The grid makes new rows itself when its plots go past the template. grid-auto-rows sets the height of those automatic rows (the implicit grid); the default is auto.
grid-template-columns on #grid using repeat() and the fr unit.minmax() inside repeat() for grid-template-columns.repeat() with auto-fill and minmax(). Leave the columns that get no plot empty.header stretched across the top, sidebar (the seedbed) bottom left, main (the rice field) bottom right. In sawah.html, #main comes before #sidebar. Map it with grid-template-areas on #layout, then give each plot its grid-area.dense placement through grid-auto-flow.#orangan) has to grow as tall as the scarecrow. Set grid-auto-rows with minmax(): a lower bound of 80 px, an upper bound of auto.hdr across the top, side (the seedbed) on the left, content (the rice field) on the right, ftr across the bottom. In sawah.html, #content comes before #side. Map it with grid-template-areas on #page and give each plot its grid-area.auto-fit, not auto-fill.#hero, runs three columns wide on the top row. Use grid-column with the span keyword.#tall grows tall, so its plot runs two rows down. Use grid-row with span.#banner starts on line 1 and stops on line 4. Write grid-column as start line / end line.grid-column: start / mid and the seedbed grid-column: mid / end. Name the lines on #grid: two 1fr columns, with the lines [start], [mid] and [end].And more, 20 levels in all.