- From: Jonathan Neal via GitHub <sysbot+gh@w3.org>
- Date: Wed, 19 Oct 2022 03:48:50 +0000
- To: public-css-archive@w3.org
> Pseudo-classes are query something about the element, whereas `:media()` is querying the viewport.
I think context _is_ something about the element. A similar API would be `:has()`.
Here is a hypothetical example of context by target class or media query:
```css
:root:is(.dark, :when(media(prefers-color-scheme: dark))) {
/* dark mode rules */
}
```
Here is a hypothetical example of context by target class or style query:
```css
:root:is(.dark, :when(style(--mode: dark))) {
/* dark mode rules */
}
```
--
GitHub Notification of comment by jonathantneal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6247#issuecomment-1283381803 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 October 2022 03:48:52 UTC