Dashboard shell
A fixed sidebar, a header strip and the workspace under it. The layout most admin screens open with.
Pikkola Layout Lab, tool No. 48
Rows, columns, spans and names on one side, a live preview on the other, and the code underneath in plain CSS or Tailwind. Every value is a real CSS value, computed in this tab and written out exactly as you see it.
The studio
Pick a preset or start from the tracks. Click a cell to change its span and its name, and watch the code follow in real time.
Each box is one track: 1fr, 240px, auto, minmax(200px, 1fr).
Click an item in the preview to set its grow, shrink and basis.
Name every cell and the export switches to grid-template-areas.
Click a cell in the preview to change how many columns and rows it covers, or to give it a name.
Five starts
Each one opens in the studio with its tracks, spans and names already set, so you can change the parts you need instead of building from nothing.
A fixed sidebar, a header strip and the workspace under it. The layout most admin screens open with.
One tall feature card, two small ones beside it, and a wide feed below. The sizes carry the hierarchy.
Header and footer, navigation on the left, an aside on the right, and the document in the middle.
A twelve column sheet: a hero over four columns and two rows, four cards of four columns each, and a strip across the page.
One column with a maximum width, centred both ways. The rows stay auto, so the content decides its own height.
How it reads
A grid is a set of lines and the spaces between them. These are the rules that decide where a cell can go, and the tool refuses to break them quietly.
01
A cell may cover several tracks in each direction, and it always covers a full rectangle. Grow a span over a neighbour and that neighbour gives way; shrink it and the free position becomes a new cell. Two cells never sit on the same square.
02
A fraction is not a percentage. The fixed tracks and the gaps are taken out first, and what remains is shared by the fr tracks. A 232px sidebar and a 1fr main in a 900px window leave the main 668px, minus the gap.
03
grid-template-areas is a picture of the whole grid, so it can only be written when every cell has a name. Name the last one and the export switches from line numbers to areas, and every child gets one grid-area instead of two coordinates.
| Property | What it decides | Tailwind |
|---|---|---|
| grid-template-columns | One size per column, in order. The number of tracks is the number of values. | grid-cols-[...] |
| grid-template-areas | The names as a picture of the grid, one quoted row per row. | [grid-template-areas:...] |
| grid-column / row | Where a cell starts and how far it reaches. The export keeps the span form. | col-span-2 row-span-2 |
| gap | The space between tracks. Rows and columns can differ. | gap-4 gap-x-[18px] |
| justify-items | Where a cell sits inside its own column when it is narrower than the track. | justify-items-center |
| align-items | Where a cell sits inside its own row when it is shorter than the track. | items-center |
| flex-basis | The size an item asks for before grow and shrink are applied. | basis-[120px] |
| align-self | One item overriding the container's align-items for itself. | self-end |
Use grid when rows and columns both matter and items should line up in two directions. Use flex when the items flow along one line and their size decides the wrapping. A sidebar with a main area is grid. A toolbar of buttons is flex. The studio keeps both, and the export never mixes them.
The fixed tracks, the gaps and the borders are subtracted from the container first. The fr tracks divide whatever is left in proportion to their numbers, so 1fr and 2fr give the second track twice the free space, not twice the total width.
grid-template-areas draws the entire grid, so every square needs a name or a dot. The builder waits until all cells are named, then writes the template and gives each child a single grid-area. Until then it exports line numbers, which are just as valid.
A fraction row has nothing to fill when the container has no height, so 1fr collapses to the content. The export sets 420px so the result looks like the preview. Delete that line when the container already has a height, such as a full page shell.
Only the first cell is left to auto flow. Every other cell is written with explicit lines, because auto placement can move a cell when a neighbour changes. Explicit lines are longer but they reproduce the preview exactly.
No. The model, the preview and both writers run in this tab, the content policy sets connect-src to none, and there is no server that could receive a layout. Only the language, the theme and the current layout are kept in this browser.