CSS Quantize

Seven demos built on one idea. A container query turns a component's width into a single number, --state, from 0 to 4, and every part of the component reads that number with calc(). Drag the corner of any stage to move through the states. No JavaScript.

01 State Machine Playground Shows the idea: a readout of the current state, a meter, and a checklist of which widths you've passed. 02 Typographic Scale Heading and body sizes come from calc(1rem + var(--state) * step), so one variable replaces five font-size overrides. 03 UI Density A card's padding, gap, radius and button size grow together as the state goes up. 04 Progressive Disclosure Card A product card that shows its rating, then reviews, then buttons, as it gets enough room for each. 05 Progressive Nav Nav links tuck into a popover menu when space is tight and come back out as it grows. 06 Responsive Data Table A price table that adds a column at each state instead of squeezing them all in at once. 07 Logic Lab Everything on one page: the state badge, a capacity signal and a flow diagram, all reading the same container as you resize it.