>
> What exactly you mean leaking style

I want to define some styles within the component that are not applied to 
anything outside of the component.

e.g. component *demo-element*

> <dom-module id="demo-element">
>   <style>
>     .foo {
>       color: red;
>     }
>  </style>
>  <template>
>    <div class="foo">This should be red!</div>
>  </template>
> </dom-module>
>
>
And using this component:
<demo-element></demo-element>
<div class="foo">Should not be red!</div>

This works perfectly for DOM elements I create myself inside the component, 
but those that are generated by D3.js do not work.
The styles are not applied to them. For these I need to use the style tag 
inside the template. Which leads to leaking the style - thus
displaying "Should not be red!" in red.


The Polymer documentation notes one should not use the regular DOM API to 
programmatically modify the DOM and use the Polymer API instead.
Well, I hope this does not mean D3.js has to be rewritten for components to 
be able to use it. ;-(

 

> BTW your {} count does not match. So maybe better look into css :D

;-)  The snippet is incomplete and only meant as an example from the D3.js 
blog.



On Friday, June 5, 2015 at 2:50:27 PM UTC+2, Robert Simon wrote:
>
> What exactly you mean leaking style
> BTW your {} count does not match. So maybe better look into css :D
>

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/300331c1-6c8b-4b4d-8bb5-18ed040001e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to