Note that container style queries only support custom properties - #45709
Open
RizgarOzan wants to merge 4 commits into
Open
RizgarOzan wants to merge 4 commits into
RizgarOzan wants to merge 4 commits into
Conversation
RizgarOzan
requested review from
dipikabh and
estelle
and removed request for
a team
September 14, 2026 17:16
Contributor
|
Preview URLs (2 pages) External URLs (4)URL:
(comment last updated: 2026-09-22 14:32:50) |
Contributor
Author
|
Friendly ping - let me know if the wording should be adjusted. |
Contributor
I shall be doing this tomorrow, thanks for the prod. |
dletorey
reviewed
Sep 22, 2026
| ### CSS | ||
|
|
||
| - The [`@container`](/en-US/docs/Web/CSS/Reference/At-rules/@container) CSS at-rule supports [`style()`](/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries#container_style_queries) queries. This allows you to check if a container has a valid CSS declaration, a CSS property, or a custom property, and apply styles to its children accordingly. ([Firefox bug 2016929](https://bugzil.la/2016929), ([Firefox bug 2019254](https://bugzil.la/2019254)), ([Firefox bug 2024601](https://bugzil.la/2024601)), [Firefox bug 2030645](https://bugzil.la/2030645)). | ||
| - The [`@container`](/en-US/docs/Web/CSS/Reference/At-rules/@container) CSS at-rule supports [`style()`](/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries#container_style_queries) queries. This allows you to check if a container has a custom property, optionally with a specific value, and apply styles to its children accordingly. As in other browsers, only custom properties are supported; queries for regular CSS properties, such as `style(color: green)`, never match. ([Firefox bug 2016929](https://bugzil.la/2016929), ([Firefox bug 2019254](https://bugzil.la/2019254)), ([Firefox bug 2024601](https://bugzil.la/2024601)), [Firefox bug 2030645](https://bugzil.la/2030645)). |
Contributor
There was a problem hiding this comment.
Suggested change
| - The [`@container`](/en-US/docs/Web/CSS/Reference/At-rules/@container) CSS at-rule supports [`style()`](/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries#container_style_queries) queries. This allows you to check if a container has a custom property, optionally with a specific value, and apply styles to its children accordingly. As in other browsers, only custom properties are supported; queries for regular CSS properties, such as `style(color: green)`, never match. ([Firefox bug 2016929](https://bugzil.la/2016929), ([Firefox bug 2019254](https://bugzil.la/2019254)), ([Firefox bug 2024601](https://bugzil.la/2024601)), [Firefox bug 2030645](https://bugzil.la/2030645)). | |
| - The [`@container`](/en-US/docs/Web/CSS/Reference/At-rules/@container) CSS at-rule supports [`style()`](/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries#container_style_queries) queries. This allows you to check if a container has a custom property, optionally with a specific value, and apply styles to its children accordingly. As in other browsers, only [custom properties](/en-US/docs/Web/CSS/Reference/Properties/--*) are supported; queries for regular CSS properties, such as `style(color: green)`, never match. ([Firefox bug 2016929](https://bugzil.la/2016929), ([Firefox bug 2019254](https://bugzil.la/2019254)), ([Firefox bug 2024601](https://bugzil.la/2024601)), [Firefox bug 2030645](https://bugzil.la/2030645)). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Firefox 151 release notes said
@container style()queries let you check "a valid CSS declaration, a CSS property, or a custom property", and the@containerreference showsstyle(background-color: red)/style(color: green)examples with no caveat. No browser supports style features other than custom properties. This updates the release note entry and adds a note to the@containerstyle query section, linking to the guide section that already covers this.Motivation
CSS Conditional 5 §6.2 allows any supported CSS property as a style feature, but every engine only implements custom properties, so readers copying the reference examples get queries that never match.
Additional details
Checked in Chromium (headless Edge 153): a container with
--x: 1; color: rgb(0, 128, 0); display: block; border: 2px solid red, where every query below is true per the spec:All of them parse (the
conditionTextis kept); they just never match.Not tested in Firefox or Safari, but their parsers only accept custom property names:
StyleFeaturePlain::parseconsumeStyleFeature(isCustomPropertyName)The containment guide already states this limitation in several places, so I left it unchanged.
Lint on the changed files: markdownlint-cli2 (repo config) 0 issues, prettier clean, cspell 0 issues.
Related issues and pull requests
Fixes #44701