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. ;-(