Container Queries in a CMS: How We Write Specs So AI Agents Build Responsive Components Correctly

Stacked shipping containers
calendar icon

Nov 10, 2026

Frequently Asked Questions

No. Container queries replace media queries inside components. Media queries remain the right tool for the page shell and for user preferences like reduced motion, color scheme and pointer type, which only the media query API can read.

Use auto-fit when items should stretch to fill the last incomplete row. Use auto-fill when items should keep their size and leave empty tracks, which keeps cards aligned with a fuller row above.
Yes, as progressive enhancement. Chrome and Safari support @container style() for custom properties, but Firefox support was still in progress as of March 2026. Make sure the default styles are complete without them.
Yes, but it's only reliable with a written spec. From Figma frames alone, agents copy pixel values and guess breakpoints. A CSS constitution plus a component spec that defines container breakpoints, slots, and edge cases makes the output predictable and reviewable.

It should include:

- The CMS slots where the component can appear in

- Its content priority

- Its layout at each container breakpoint

- The tokens it uses

- Its variants

- Its edge cases and matching content-model limits

- Acceptance criteria tied to specific container widths

Declare the container on the wrapper that the CMS renders around a placeholder or content area. Every component placed there then responds to the slot's real width. An author can drop it into a sidebar or a full-width column without breaking the layout.
A valid name is required
A company name is required
Please enter your work email address
Please enter a message

This site is protected by reCAPTCHA, and our Privacy Policy applies.

LLM Markdown version of this page