-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
35 lines (31 loc) · 1022 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@next/webcomponents-loader.js"></script>
</head>
<body>
<!-- Loads natively on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 16. For all others, use a
module-compatible toolchain like Polymer CLI, WebPack, or Rollup -->
<script type="module">
import { PolymerElement, html } from '@polymer/polymer'
class MyElement extends PolymerElement {
static get properties() {
return { mood: String }
}
static get template() {
return html`
<style>
.mood {
color: green;
}
</style>
Web Components are <span class="mood">[[mood]]</span>!
`
}
}
customElements.define('my-element', MyElement)
</script>
<my-element mood="awesome"></my-element>
</body>
</html>