#1176: Incubation: @supports at-rule

Visit on Github

Opened Dec 9, 2025

Explainer

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/AtRuleFeatureDetection/explainer.md

The explainer

Where and by whom is the work is being done?

Feedback so far

You should also know that...

No response

<!-- Content below this is maintained by @w3c-tag-bot -->

Track conversations at https://tag-github-bot.w3.org/gh/w3ctag/design-reviews/1176

Discussions

Log in to see TAG-private discussions.

Discussed Dec 15, 2025 (See Github)

Christian: Think this is about feature detecting at-rules themselves, kind of meta-feature detection.

Lola: I will have a look at this.

Christian: I will join.

Discussed Jan 5, 2026 (See Github)

CHristian: Had a first look. Seems fine, but want to do another pass. Terminology and other things. This lets you detect @-rule support in the browser. Elaborate.

Yves: Is it an @-rule extension?

Martin: It extends @supports, with a new syntax. My only concern is, it looks fiddly. Documentation is going to important.

Discussed Jan 12, 2026 (See Github)

Christian: No update.

Lola: No update.

Discussed Jan 19, 2026 (See Github)

Christian: I think this is fine. However, it has some issues. Martin observed last week that it adds some complexity, which is true. You can query for an at-rule. There's the @charset rule, which will not be detected (that is fine). It checks for the at-rule in any context. Context doesn't matter. If the at-rule is only valid in a certain sub-context, you might get a false positive. I want to ask them about this - why is it designed like this (and not, e.g. context-sensitive)?

... There's also a special case for MQs, which are parsed differently. Makes sense from a technological standpoint, but could be confusing for developers (maybe this is what Martin meant).

... I plan to ask the questions.

Lola: What is the consequence of a false positive in this case?

Christian: You could think that a feature is available when it's not.

... They have a nice example in the Explainer. Is it OK for me to ask my proposed question?

Lola: Sure

Comment by @christianliebel Jan 19, 2026 (See Github)

@diekus @kbabbitt Thank you for your proposal and the great explanation of the problem space. We have a question: The proposal states that at-rule() returns true if the at-rule name is recognized in any context. As you describe, this introduces the risk of contextual false positives. Did you evaluate context-aware detection? If so, why did you prioritize global recognition over contextual validity?

Comment by @kbabbitt Jan 19, 2026 (See Github)

@christianliebel We did consider context-aware detection. When we discussed this problem space at a CSSWG face-to-face meeting last fall, the group resolved to introduce a new @supports-condition as a way of both defining and naming (for reuse) complex support queries such as those that need to account for context, and to keep at-rule() simple as an author convenience. Discussion in https://github.com/w3c/csswg-drafts/issues/12622 and https://github.com/w3c/csswg-drafts/issues/6966#issuecomment-3205037703.

Discussed Jan 26, 2026 (See Github)

Lola: Both comments (for this and 1186) LGTM.

Christian: Thanks; will post.

Comment by @christianliebel Jan 26, 2026 (See Github)

@kbabbitt Thanks for the answer. It would be great if you could add those two links to the explainer for future reference.

We think extending @supports to detect the presence of at-rules is great for progressive enhancement. We are closing this review as satisfied with concerns, with the two primary concerns being:

  1. The global recognition of at-rules may lead to false positives.
  2. The special handling of media queries, where support is only returned if the at-rule is parsed on the "known media features" path, may be confusing for developers.

We think the benefits outweigh these concerns, but we recommend clearly documenting this behavior in developer materials (MDN, etc.), including the treatment of @charset.

Furthermore, we ask that you ensure cross-vendor consensus.

(Side note: We believe that feature detection might theoretically allow for fingerprinting. While feature support could be derived from the user agent string, initiatives are underway to reduce its entropy, such as by freezing or restricting it. In that case, feature detection might provide an additional fingerprinting bit. However, depending on the exact feature, developers are likely already able to query support by defining a certain style and checking if it is applied properly.)

Comment by @diekus Jan 27, 2026 (See Github)

Thanks @christianliebel ! I will ad this to the explainer and we will follow up on the cross-vendor support!