W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

Re: [csswg-drafts] [css-scoping][selectors] Should :where(:host) work? (#6420)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Sat, 03 Jul 2021 15:58:51 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-873428764-1625327929-sysbot+gh@w3.org>
`:where` wouldn't fix that either, since the rules from inside and outside the shadow tree are not sorted by specificity.

What you describe should already be working, as rules from outside the shadow tree go before (non-important) rules from inside the shadow tree:

```html
<!doctype html>
<style>
  [hidden] { display: none }
</style>
<div id="host" hidden>Can you see me?</div>
<script>
  document.getElementById("host").attachShadow({ mode: "open" }).innerHTML = `<style>:host { display: block }</style>`;
</script>
```

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 3 July 2021 15:58:53 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:25 UTC