Skip to content

Instantly share code, notes, and snippets.

@crysfel
Created May 11, 2015 18:38
Show Gist options
  • Save crysfel/2f47a3cd7c68f5ba1a9d to your computer and use it in GitHub Desktop.
Save crysfel/2f47a3cd7c68f5ba1a9d to your computer and use it in GitHub Desktop.
Web Component Template
// Grab our template full of slider markup and styles
var tmpl = document.querySelector('template'); //Step 1
// Setup our Shadow DOM and clone the template
Panel.createdCallback = function() { //Step 2
var root = this.createShadowRoot(), //Step 3
close;
root.appendChild(document.importNode(tmpl.content, true)); //Step 4
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment