Re: [csswg-drafts] [css-selectors] Allow relative selectors everywhere (#8010)

> A top-level style rule `> .bar{}` doesn't seem particularly clear to me.

I agree, but I think this is also true for `.foo { > .bar {} }`
I prefer to have everything explicit as I think the resulting stylesheet is easier to maintain and understand (even for people who are not an expert in CSS).

> `element.querySelector("> .foo")`

I hadn't yet thought about `querySelector` and friends. Yes those already support `:scope` today and this would indeed be convenient.

Another one is `@supports`:

```css
html {
 > body {
  color: red;
 }
}

@supports selector(> body) {
 html {
  > body {
   color: green;
  }
 }
}
```

This supports check fails because relative selectors are not allowed here.

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


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

Received on Friday, 4 November 2022 07:01:20 UTC