Last active
February 5, 2017 15:47
-
-
Save trknhr/548ad22836bbdd4340789a2d48e472cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
class HelloWorld extends HTMLElement{ | |
constructor(){ | |
//always first | |
super() | |
const shadow = this.attachShadow({mode:'open'}); | |
shadow.innerHTML = | |
` | |
<style> | |
.content { | |
font-weight: bold; | |
background: #F5F5F5; | |
} | |
</style> | |
<div class="content">Hello world</div> | |
` | |
} | |
} | |
customElements.define('hello-world', HelloWorld); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment