Frontend Syntax CSS Container Queries

Use when a component's layout has to react to the width or aspect of its own parent rather than the viewport, when card or panel content collapses or stretches at the wrong breakpoint, when reusable components need to behave differently in a narrow sidebar versus a wide main column, or when a theme switch driven by a custom property should style its descendants without descendant-explosion selectors. Prevents the classic "media-query at the component" mistake, container query units (`cqi`, `cqw`) falling back silently to viewport units, layout collapse from setting `container-type: size` without an explicit height, descendant containers shadowing ancestor containers in unexpected ways, and shipping a Baseline 2025 style container query without a feature gate. Covers the full `container-type` value set (`size`, `inline-size`, `normal`), the `container-name` opt-in plus the `container` shorthand, anonymous and named `@container (width > X)` queries, the six container query length units (`cqw`, `cqh`, `cqi`, `cq

Impertio-Studio 301ada9 4 files · 34.9 KB Updated

File contents

impertio-studio/frontend-design-claude-skill-package/tree/main/skills/source/frontend-syntax/frontend-syntax-css-container-queries commit 301ada91e3

Frequently asked questions

npx skillmds@latest add impertio-studio/frontend-syntax-css-container-queries