← Back to release summary

named-feature() function for CSS @supports

Category
CSS
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

The named-feature() function allows CSS @supports rules to query for a small set of specific named features that are not possible to test for using other @supports mechanisms but which are considered highly valuable to test for.

Motivation

Sometimes we add new features to CSS where two things are simultaneously true: first, that CSS authors see high value in writing conditional styles for whether the feature is supported using @supports, and second, that the existing mechanisms in @supports don't provide a useful way to test for the feature. This provides a way for us to give names to a small number of high-value features so that CSS authors can test for them in their style sheets. We will ship initially with a single supported feature, identified by the anchor-position-follows-transforms keyword.

Standards & signals

Explainers: https://github.com/w3c/csswg-drafts/blob/main/css-conditional-5/named-feature-explainer.md

View on chromestatus.com