File size: 753 Bytes
3a08226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class ArchAppGrid extends HTMLElement {
    constructor() {
        super();
        this.attachShadow({ mode: 'open' });
    }

    connectedCallback() {
        this.render();
    }

    render() {
        this.shadowRoot.innerHTML = `
            <style>
                :host {
                    display: grid;
                    grid-template-columns: repeat(4, 1fr);
                    gap: 16px;
                    padding: 8px;
                }
                @media (min-width: 768px) {
                    :host {
                        grid-template-columns: repeat(6, 1fr);
                    }
                }
            </style>
            <slot></slot>
        `;
    }
}

customElements.define('arch-app-grid', ArchAppGrid);