CSS style queries now support range syntax with comparison operators (>, <, >=, <=) as of Chrome 142, similar to media and container queries. This enhancement allows developers to query custom properties based on ranges rather than exact values, enabling more flexible responsive components. The feature works with @container style() queries and the CSS if() function, supporting comparisons of numeric data types like percentages, lengths, and angles. Practical applications include conditional styling based on data attributes, grid positioning, and dynamic component variations.
Table of contents
Range Syntax for Style QueriesDemo: Weather cardsUsing Range Syntax with if()Demo: Grid positionSort: