[csswg-drafts] [scoping] Direct parent of a :host-context() (#7896)

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

== [scoping] Direct parent of a :host-context() ==
I have a custom element  `<my-elem>` and I would like only the one whose parent with class `row` to be affected:

```css
<style>
  /* ... */
  :host-context(.row >) > div {
    background-color: blue;
  }
</style>
```

```html
<div class=".row">
  <div>
    <my-elem>
      <div>DIV!</div>
      <main>MAIN!</main>
      <aside>ASIDE!</aside>
    </my-elem>
  </div>
<div>
<div class=".row">
  <my-elem>
    <div>DIV!</div>  <!-- Only this element -->
    <main>MAIN!</main>
    <aside>ASIDE!</aside>
  </my-elem>
<div>
<my-elem>
  <div>DIV!</div>
  <main>MAIN!</main>
  <aside>ASIDE!</aside>
</my-elem>
```

This doesn't seem possible, because `>` at the end of the selector is not valid.

There is a reason for this? If so, how can I do without?

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


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

Received on Tuesday, 18 October 2022 07:21:16 UTC