Skip to content

FF149 @container query is optional#29300

Open
hamishwillee wants to merge 5 commits intomdn:mainfrom
hamishwillee:ff149_at_container_queryless
Open

FF149 @container query is optional#29300
hamishwillee wants to merge 5 commits intomdn:mainfrom
hamishwillee:ff149_at_container_queryless

Conversation

@hamishwillee
Copy link
Copy Markdown
Contributor

FF149 adds support for @container selections where the <container-query> part is optiona in https://bugzilla.mozilla.org/show_bug.cgi?id=2016474

This allows you to just select a container based on its name:

@container --name {}

This adds the subfeature. You can test this using https://wpt.live/css/css-conditional/container-queries/query-container-name.html

Note that I have set Chrome and Safari as false but you can tell it is coming because they pass the test on the latest versions but NOT on current versions I can access: https://wpt.fyi/results/css/css-conditional/container-queries/query-container-name.html?label=master&label=experimental&aligned

Related docs work can be tracked in mdn/content#43212

@github-actions github-actions bot added data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed labels Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>
@hamishwillee hamishwillee requested a review from caugner March 23, 2026 00:50
@hamishwillee
Copy link
Copy Markdown
Contributor Author

Thanks @caugner - I accepted all.

@frehner
Copy link
Copy Markdown

frehner commented Mar 24, 2026

Update: this was just released in Safari 26.4! https://webkit.org/blog/17862/webkit-features-for-safari-26-4/

},
"container_query_optional": {
"__compat": {
"description": "name-only container queries",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous version of the description was consistent with prior art, see this GitHub search.

Suggested change
"description": "name-only container queries",
"description": "`<container-query>` is optional",

}
}
},
"container_query_optional": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"container_query_optional": {
"container-query_optional": {

"spec_url": "https://drafts.csswg.org/css-conditional-5/#typedef-container-condition",
"support": {
"chrome": {
"version_added": "preview"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we link a bug, assuming the ship/enable commit happens in the same issue?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was just created yesterday https://chromestatus.com/feature/5184267522015232

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says it'll be turned on in 148 -- though I have Canary installed at 148 and the wpt.live page still doesn't pass. 🤷

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants