Last active
February 21, 2024 18:49
Revisions
-
thescientist13 revised this gist
Feb 21, 2024 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,10 @@ export default class HeroBanner extends HTMLElement { connectedCallback() { if(!this.shadowRoot) { this.attachShadow({ mode: 'open' }); // with DOM Parts? // template.replace('some-binding', 'some value'); this.shadowRoot.appendChild(template.content.cloneNode(true)); this.shadowRoot.adoptedStyleSheets = [sheet]; } -
thescientist13 revised this gist
Feb 21, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ // this vision aims to support the separation of concerns / technologies use case for Web Components import sheet from './hero.css' with { type: "css" }; import template from "./hero.html" with { type: "html" }; -
thescientist13 created this gist
Feb 21, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ :host { text-align: center; margin-bottom: 40px; } :host h2 { font-size: 3em; } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ <div class="hero"> <h2>This is a really nice website!/h2> </div> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // this vision aims to support the separation of concerns / technologies use case for GreenwoodJS import sheet from './hero.css' with { type: "css" }; import template from "./hero.html" with { type: "html" }; export default class HeroBanner extends HTMLElement { connectedCallback() { if(!this.shadowRoot) { this.attachShadow({ mode: 'open' }); this.shadowRoot.appendChild(template.content.cloneNode(true)); this.shadowRoot.adoptedStyleSheets = [sheet]; } } } customElements.define('app-hero', HeroBanner)