- From: Romain Menke via GitHub <sysbot+gh@w3.org>
- Date: Fri, 16 Aug 2024 10:12:56 +0000
- To: public-css-archive@w3.org
This has some overlap with [my proposal to add an `@element` at rule](https://github.com/w3c/csswg-drafts/issues/10509).
I agree that needing to create otherwise useless elements in markup, purely for style queries is an anti-pattern.
Maybe even both proposals are useful for subtly different cases?
### `@element`
```css
@element style(--color: pink) {
.foo {
background-color: pink;
}
}
```
`.foo` matches **elements** with class `.foo` and a custom prop `--color` with value `pink`
### `:container`
```css
@container style(--color: pink) {
:container {
background-color: pink;
}
}
```
`:container` matches **containers** with a custom prop `--color` with value `pink`
--
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10744#issuecomment-2293234014 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 16 August 2024 10:12:57 UTC