Good question. The recommended approach is to load the css in the scope in
which it should apply. If you need scope crossing selectors, you'll need to
rewrite the styling with ^ and ^^.

While it's true that the removal of applyAuthorStyles makes this particular
use case more difficult, there were good reasons for its removal:

(1) applyAuthorStyles was always intended as a stop-gap. The right answer
is to specifically style each scope, as mentioned above.
(2) applyAuthorStyles had a built in footgun. While it allowed selectors to
jump scopes, the selectors had to match entirely within a given scope, e.g.
'ul li' would not match if the li was in the ul's shadowRoot. This meant it
would sometimes work, but it would sometimes not and figuring out why was
very arcane.


On Tue, Jan 28, 2014 at 10:18 AM, Julien Eluard <[email protected]>wrote:

> Hi,
>
> (Apologies if this is not the right place to discuss the following)
>
> I used to rely on 'applyAuthorStyles' to apply styles available from the
> main document to components relying on ShadowDOM. A typical usage is having
> all basic elements share styles defined by CSS framework (bootstrap,
> foundation). 'applyAuthorStyles' has been removed from the ShadowDOM spec
> and recently from Chrome Canary so I am looking for a replacement.
>
> It does not appear ^ and ^^ could help as they can't refer to existing CSS
> rules. They do work when user defines their own rules though.
>
> What is the recommended way to achieve that?
>
> Thanks,
> Julien
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/4bb69407-92c0-4bf2-a296-8c3646164039%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZiVKjnh0aHQNJwqBY56guU1bOuE0%3D9U_0UdPJBdFbFupA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to