← Back to release summary

@supports selector() feature query function

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 83)
Intent stage
Evaluate readiness to ship

Summary

Adds a function that queries whether a user agent supports a selector.

Motivation

Web authors can use this feature to query whether the UA supports the selector before they actually try to apply the specified style rules matching the selector.

Standards & signals

Docs: None.

Samples: The 3 tests below is for testing feature query function of css selector. https://github.com/web-platform-tests/wpt/blob/master/css/css-conditional/at-supports-040.html https://github.com/web-platform-tests/wpt/blob/master/css/css-conditional/at-supports-041.html https://github.com/web-platform-tests/wpt/blob/master/css/css-conditional/at-supports-042.html

Explainers: https://github.com/dbaron/css-supports-functions/blob/master/explainer.md

View on chromestatus.com