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
npx react-create-app my-app |
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
<status-bar></status-bar> |
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
<div class="status-bar"> | |
<div class="size"> | |
<div class="small">-</div> | |
<div class="big">+</div> | |
</div> | |
<div class="status-bar-progress"> | |
<div class="progress"> | |
<div class="progress-percentage"></div> | |
</div> | |
</div> |
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
<alpha-paragraph color="blue"> | |
<p slot="paragraph-text"> | |
Custom Text | |
</p> | |
</alpha-paragraph> |
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
class Paragraph extends HTMLElement { | |
constructor() { | |
super() | |
// Attach shadow DOM | |
let shadow = this.attachShadow({mode: 'open'}); | |
// Append our Paragraph | |
shadow.innerHTML = ` | |
<slot name="paragraph-text"><p>Default Text</p></slot> | |
<p>Another, unchangeable paragraph</p> |
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
<alpha-paragraph color="blue"> | |
<p slot="paragraph-text"> | |
Custom Text | |
</p> | |
</alpha-paragraph> |
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
class Paragraph extends HTMLElement { | |
constructor() { | |
super() | |
// Attach shadow DOM | |
let shadow = this.attachShadow({mode: 'open'}); | |
// Append our Paragraph | |
shadow.innerHTML = ` | |
<slot name="paragraph-text"><p>Default Text</p></slot> | |
<p>Another, unchangeable paragraph</p> |
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
<template id="alphaParagraph"> | |
<slot name="paragraph-text"><p>Default Text</p></slot> | |
<p>Another, unchangeable paragraph</p> | |
</template> |
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
class Paragraph extends HTMLElement { | |
constructor() { | |
super() | |
// Attach shadow DOM | |
let shadow = this.attachShadow({mode: 'open'}); | |
// Append our Paragraph | |
shadow.innerHTML = '<p>Hello</p>' | |
// Add in our CSS |
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
class Paragraph extends HTMLElement { | |
constructor() { | |
super() | |
this.innerHTML = '<p>Hello</p>' | |
} | |
connectedCallback() { | |
// ... | |
} | |
attributeChangedCallback() { | |
// ... |