W3C home > Mailing lists > Public > www-style@w3.org > January 2015

Re: Shadow tree style isolation primitive

From: <chaals@yandex-team.ru>
Date: Mon, 12 Jan 2015 15:13:02 +0300
To: Anne van Kesteren <annevk@annevk.nl>, "www-style@w3.org" <www-style@w3.org>, WebApps WG <public-webapps@w3.org>
Message-Id: <15151421064782@webcorp02h.yandex-team.ru>
09.01.2015, 16:42, "Anne van Kesteren" <annevk@annevk.nl>:
> I'm wondering if it's feasible to provide developers with the
> primitive that the combination of Shadow DOM and CSS Scoping provides.
> Namely a way to isolate a subtree from selector matching (of document
> stylesheets, not necessarily user and user agent stylesheets) and
> requiring a special selector, such as >>>, to pierce through the
> boundary.

Sounds like a reasonable, and perhaps feasible thing to do, but the obvious question is "why?"

The use cases I can think of are to provide the sort of thing we do with BEM today. Is the effort worth it, or are there other things I didn't think of (quite likely, given I spent multiple seconds on the question)?



> This is a bit different from the `all` property as that just changes
> the values of all properties, it does not make a selector such as
> "div" no longer match.
> So to be clear, the idea is that if you have a tree such as
> <section class=example>
> <h1>Example</h1>
> <div> ... </div>
> </section>
> Then a simple div selector would not match the innermost div if we
> isolated the section. Instead you would have to use section >>> div or
> some such. Or perhaps associate a set of selectors and style
> declarations with that subtree in some manner.
> --
> https://annevankesteren.nl/

Charles McCathie Nevile - web standards - CTO Office, Yandex
chaals@yandex-team.ru - - - Find more at http://yandex.com
Received on Monday, 12 January 2015 12:13:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:50 UTC