calc() and clamp().
15
The Holy Albatross
Heydon Pickering's original trick. Three items go straight from a row to a column, and you never get two on top with one left below.
16
Container-Scoped Albatross
Both articles combined. One calc() switch changes the layout, radius and gap at once, without any @container rules.
17
Chained Albatross
Two calc() switches take the layout from one row to two columns to fully stacked.
18
Container Style Queries
A container query that checks a custom property instead of a size. Click the toggle to flip @container style(--variant: accent).
19
Shape-Aware Container
The card changes layout based on its shape, using @container (aspect-ratio < 1).
20
Animatable Constraint Switch
Demo 16's switch again, registered with @property so it eases between layouts instead of snapping.
21
Integer Grid Steps
round() works out how many fixed-width columns fit in the container.
22
Aspect-Ratio Gallery
Four containers that each react to their shape in a different way: a compound range, orientation, min-aspect-ratio and a one-sided range.
23
Shape-Morphing Child
One element that becomes a circle, a square or a rectangle depending on the shape of its container.