TAG ยท layout
Layout in CSS: grid, subgrid and container queries
Grid, subgrid, container queries, anchor positioning and viewport units, with the cases where each one quietly does nothing. 17 elements, each rendered live with its source and the one thing that breaks it.
- A component that reads its own token @container style()
- The full height a phone actually gives you svh / dvh / lvh
- A bar sized by its own data attribute attr() type()
- Card rows that line up across cards subgrid
- The fixed element that stopped meaning it fixed under transform
- A layout drawn as a picture of itself grid-template-areas
- Why the last row stretches, and how to stop it auto-fit vs auto-fill
- Centring with no flex and no grid align-content (block)
- A vertical label that does not break the box writing-mode: vertical-rl
- A tooltip that follows its anchor with no JavaScript anchor-name + position-area
- Styles that stop at a boundary you name @scope
- Clipping that leaves sticky alone overflow: clip
- resize keeps writing after max-width stops it resize + max-width
- A card that reads its own container, not the window @container
- Type that scales with its container cqi
- Boxes that keep their proportions aspect-ratio
- A layout that changes when the list gets long :has(:nth-child())