v149 · css · developer trial
Comma-separated Container Queries
Chrome 149 lets you write multiple @container conditions in a single rule, separated by commas. The block applies if any one of the conditions matches — the same OR semantics as comma-separated @media queries.
chrome://flags/#enable-experimental-web-platform-features to test. Ships as enabled by default in Chrome 150.
at a glance
| Status in 149 | In developer trial (behind a flag) |
|---|---|
| Ships by default | Chrome 150 |
| Flag | chrome://flags/#enable-experimental-web-platform-features |
| Standards position | Firefox: Shipped · Safari: No signal |
| Spec | CSS Conditional Rules Level 5 §@container |
| ChromeStatus | 6196591858941952 — Comma-separated Container Queries |
why it exists
Container queries already have and, or, and not logic inside a single condition. But you couldn't write two separate conditions in the same rule that applied if either matched — you had to duplicate the entire rule body. Comma separation mirrors the @media pattern: each comma-separated entry is an independent condition; the block applies if at least one passes. The main use-case is feature-query fallbacks: you can list a new container feature first, then fall back to a simpler width query for browsers that don't support it yet.
syntax
/* Before: two identical rule bodies */
@container sidebar (min-width: 300px) {
.card { flex-direction: row; }
}
@container sidebar (style(--layout: horizontal)) {
.card { flex-direction: row; }
}
/* After: one rule, OR semantics */
@container sidebar (min-width: 300px),
sidebar (style(--layout: horizontal)) {
.card { flex-direction: row; }
}
You can also target different named containers in the same comma list:
/* Apply if EITHER container matches */
@container main (min-width: 600px),
sidebar (min-width: 200px) {
.widget { display: grid; }
}
Source: chromestatus summary examples + CSS Conditional Rules 5 §container-rule.
recipes
Feature + fallback width query
/* Use scroll-state() where supported; fall back to width for older browsers */
@container card (scroll-state(stuck: top)),
card (min-width: 400px) {
.card-header {
position: sticky;
top: 0;
background: white;
}
}
Targeting alternate container names
.sidebar { container: sidebar / inline-size; }
.main { container: main / inline-size; }
/* Compact layout if EITHER column is narrow */
@container sidebar (max-width: 200px),
main (max-width: 400px) {
nav { display: none; }
}
browser support
| Chrome | 149 |
|---|---|
| Edge | 149 (Chromium) |
| Firefox | Shipped |
| Safari | No signal |