Re: [csswg-drafts] [css-conditional] `@supports-condition`, for larger feature queries and named reuse (#12622)

This seems like a very neat solution to multiple problems! My initial concern was how to disambiguate the parsing between declarations and style rules, but I think that's already solved because otherwise nesting wouldn't work. Though... if you wanted to test both a declaration and something else in the same `@supports-condition`, it gets a bit weird that declarations can be raw like that. eg, what context are we parsing things in here?
```css
@supports-condition --multiple-things {
 color: light-dark(red, green);
 @page {
  margin: auto;
 }
}
```
Declarations could always be tested with `* { /* declarations here */ }` so maybe the raw-declarations thing isn't necessary? It's nicer to author but just makes things a bit more confusing.

> I think I like it, too, but for the “More natural syntax for `selector()`”, I’m afraid an empty rule block might be optimized away together with its selectors, so I’d suggest to put _something_ inside.

I don't think that's an issue. An empty style rule can't be optimized away because it's observable through the CSSOM. (Also, inside a supports query you're just testing if something can parse, not that it would exist and be useful, so there shouldn't be any such optimizations done.)

-- 
GitHub Notification of comment by AtkinsSJ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12622#issuecomment-3202431555 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 19 August 2025 22:25:21 UTC