container query units
CSS length units measured against the query container: 1cqi is one percent of its inline size, 1cqw of its width, 1cqh of its height.
In more detail
cqmin and cqmax use the smaller or larger of the two dimensions. They let typography and spacing scale with the component's own box instead of the viewport, so a card in a 320px sidebar gets proportionally smaller padding.
Related terms
- container query — A CSS rule, written with @container, that styles a component based on the size of its container instead of the whole viewport.
- container-type — The CSS property that turns an element into a query container that its descendants can run container queries and container units against.
- logical properties — CSS sizes and directions described by writing direction, inline along a line of text and block across lines, instead of left, right, top and bottom.
Taught in
- Container Queries: Component-Driven Responsive Design — Frontend Architecture & Web Platform