RE: [Shadow] Q: Removable shadows (and an idea for lightweight shadows)?

>From: Daniel Freedman [mailto:dfreedm@google.com] 
>How would you style these "shadow" children? Would the main document CSS styles affect these children?

I don’t know :-)

Let's assume that main document CSS styles wouldn't affect them, as that seems to be a fundamental requirement for shadowDOM.

So, then how to style them? Here's a few thoughts--but what do you think?

* Require scoped style elements. This is today's model. I don't like it much because of the developer ergonomics--it's not as natural as the way styles are applied to documents today with <link rel="stylesheet">

* provide new APIs to manage stylesheets for the shadow content. Maybe: element.importShadowStyleSheet(url), and then a corresponding element.shadowStyleSheets[] collection. This seems vaguely reminiscent of an imperative @import. Might be better to just add this capability [generally] to the styleSheets collection [1] come to think of it...

* other ideas?

[1] http://dev.w3.org/csswg/cssom/#stylesheetlist

 

Received on Thursday, 26 March 2015 19:45:24 UTC