Hello!
 
As I understand current spec [1] there is only two ways to provide styles
for DOM elements in shadow trees:
1) add styles to document and set apply-author-styles flag for shadow tree or
2) use inline styles for elements under the shadow root.
But both of them look not very useful for Custom Elements [2] creation.
 
The first option clearly is not the best pick since the apply-author-styles flag
will cause document styles to affect shadow tree elements
and it might lead to undesired results.
 
The second one is more suitable but also has some disadvantages.
The main one is that CSP of the page might forbid inline styling,
styles will not be applied to shadow tree elements
and the whole custom element might become unusable.
 
My question is – is there the way to avoid these issues with current spec?
And if not, will it make sense to allow link[rel=stylesheet] element
to be shadow root child?
 
 
[1] http://www.w3.org/TR/2013/WD-shadow-dom-20130514/
[2] http://www.w3.org/TR/2013/WD-custom-elements-20130514/
 
----
Alexey

Reply via email to