Skip to content

Commit

Permalink
Merge pull request #16 from DaleStudy/sam/add-hero-component
Browse files Browse the repository at this point in the history
feat : implemented hero component
  • Loading branch information
SamTheKorean authored Jun 7, 2024
2 parents 9ed08fc + 50bf2db commit 0bd754e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/hero/hero.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.hero-description {
font-size: 5rem;
font-weight: medium;
}
17 changes: 17 additions & 0 deletions components/hero/hero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const template = document.createElement('template');
template.innerHTML = `
<link rel="stylesheet" href="./components/hero/hero.css">
<p class="hero-description">
<slot></slot>
</p>
`;

class Hero extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
}

window.customElements.define('hero-component', Hero);
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import "./components/divider/divider.js";
import "./bomponents/hero/hero.js";

0 comments on commit 0bd754e

Please sign in to comment.