[csswg-drafts] [css-extensions] Custom container queries (#8121)

romainmenke has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-extensions] Custom container queries ==
This was requested in https://github.com/csstools/postcss-plugins/pull/671

This would be in parallel with [`@custom-media`](https://www.w3.org/TR/mediaqueries-5/#custom-mq).

```
@custom-container <extension-name> <container-condition>
```

```css
@custom-container --foo card (inline-size > 30em) and style(--responsive: true)

@container (--foo) {
  /* styles */
}
```

I personally do think the benefits of having this are smaller than they are with `@custom-media`.
The same media conditions are often re-used throughout an entire code base.

Assigning these to a named variable has obvious code quality benefits.

Container queries however are much more local.
They are more often tied to the code contained therein.
I can be wrong about this, this is purely my impression.

Maybe @mirisuzanne [proposal to allow `var()` inside `<container-condition>`](https://github.com/w3c/csswg-drafts/issues/8088) is all authors need?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8121 using your GitHub account


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

Received on Tuesday, 22 November 2022 10:55:17 UTC