← Back to release summary

CSS @container with unsupported Features never match

Category
CSS
Type
No developer-visible change
Status
Enabled by default (Chrome 122)
Intent stage
None

WPT details: https://wpt.fyi/css/css-contain/container-queries/container-selection-unknown-features.html https://wpt.fyi/css/css-contain/container-queries/query-evaluation.html https://wpt.fyi/css/css-contain/container-queries/query-evaluation-style.html

Summary

@container selectors that contain unsupported queries will never select any containers, meaning they will never match. That means this query will never match any container even if there is a size container that will match the width query that would otherwise make the selector match in cases like this: @container (width > 0px) or (unknown) {} This is a recent change to the specification to avoid forward-compatibility issues.

Motivation

Spec changed for better forward compat. Want to ship change before counter increases: https://chromestatus.com/metrics/feature/timeline/popularity/4596

Standards & signals

Ecosystem

View on chromestatus.com