CSS Container Query Generator
Wrap CSS in a @container query, plus the container-type/container-name it needs on the parent -- with a REAL live-resizable preview box (drag its corner handle) so you can watch the browser's own container-query engine apply your styles as it crosses the threshold, no simulation needed. Multi-condition support, presets, and export to CSS, SCSS or React.
What this tool does
Builds a @container query — CSS's element-based
alternative to viewport-based media queries, where a component
restyles based on the size of its own container rather than the
whole browser window — along with the
container-type/container-name
declaration the parent element needs for the query to work at
all.
A real resize, not a simulation
The preview box has an actual drag handle (CSS resize:
both) — dragging it resizes a real container element, and
the browser's own container-query engine restyles the content
inside it live as it crosses the configured threshold. This is
the genuine CSS feature at work, not a JavaScript approximation
of what it would do, with a ResizeObserver readout
showing the exact container dimensions as you drag.
Container type and multiple conditions
Container type can be inline-size (width only,
the common case), size (width and height, needed for
height-based conditions), or normal. Any number of
conditions — min/max width, min/max height, aspect ratio, or
orientation — can be ANDed together, matching how real
@container queries are written.
Presets and the CSS to apply
Five presets — Card Layout, Sidebar Collapse, Compact Header, Wide Grid, and Tall Container — cover common component-resize patterns. The CSS the query applies is directly editable, so the exported rule is complete and ready to use.
Getting it out
Export as plain CSS, SCSS, or a React-oriented note (since
@container can't be expressed as an inline style
object and needs a real stylesheet), copyable with one click.
Privacy
Everything runs locally in your browser -- nothing you build is sent to a server.