Re: [csswg-drafts] [css-cascade-6] A way for <style> elements to scope to their parent element (#6606)

As is typical for spec bugs, I think I've got two ideas piled into one:

1. I've got a problem: I want to be able to refer to the nested `<style>` element's parent.
2. I suggest a solution: A new pseudo-class `:style-parent` (or `:style-root` or `:style-host`, yeah) that would refer to the parent element of a nested `<style>`. (As you point out, that would not be meaningful for stylesheets in the `<head>`, so presumably in that case we'd want it to refer to `:root`.)

If `:style-parent` isn't feasible for some reason, I'd still wish for _some_ solution to the problem. I guess I could try to invent a handful of other solutions…? (The `scoped` attribute `<style scoped>` could literally be another alternative, for example.)

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


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

Received on Monday, 13 September 2021 17:06:08 UTC