WebCraft

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.

  1. A component that reads its own token @container style()
  2. The full height a phone actually gives you svh / dvh / lvh
  3. A bar sized by its own data attribute attr() type()
  4. Card rows that line up across cards subgrid
  5. The fixed element that stopped meaning it fixed under transform
  6. A layout drawn as a picture of itself grid-template-areas
  7. Why the last row stretches, and how to stop it auto-fit vs auto-fill
  8. Centring with no flex and no grid align-content (block)
  9. A vertical label that does not break the box writing-mode: vertical-rl
  10. A tooltip that follows its anchor with no JavaScript anchor-name + position-area
  11. Styles that stop at a boundary you name @scope
  12. Clipping that leaves sticky alone overflow: clip
  13. resize keeps writing after max-width stops it resize + max-width
  14. A card that reads its own container, not the window @container
  15. Type that scales with its container cqi
  16. Boxes that keep their proportions aspect-ratio
  17. A layout that changes when the list gets long :has(:nth-child())