Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <element name="x-foo-shadow" constructor="XFooShadow">
  2.   <template>
  3.     <style>
  4.       @host { * { display: block; background: #ffcc00; ... } }
  5.     </style>
  6.     <section>I'm an x-foo-shadow. Gots me some Shadow DOM!</section>
  7.   </template>
  8.   <script>
  9.     var template = this.querySelector('template');
  10.     this.register({ // this == <element>
  11.       prototype: {
  12.         readyCallback: function() {
  13.           this.createShadowRoot().appendChild(template.content.cloneNode(true));
  14.         }
  15.       }
  16.     });
  17.   </script>
  18. </element>