File size: 754 Bytes
9113b22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// This is an example of a web component - not used in this specific implementation
class CustomExample extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
          padding: 1rem;
          background-color: #f3f4f6;
          border-radius: 0.5rem;
          margin-bottom: 1rem;
        }
        
        h2 {
          margin-top: 0;
          color: #1f2937;
        }
        
        p {
          color: #6b7280;
        }
      </style>
      <div>
        <h2>Web Component Example</h2>
        <p>This is a reusable web component.</p>
      </div>
    `;
  }
}

customElements.define('custom-example', CustomExample);