Web Components
Features
- Scoped
- Reusable
- Encapsulated
Made by 4 main technologies
- HTML Template
- Custom Elements
- Shadow DOM
- HTML Imports
Basic Web Components
- Card Title
- Component Title
1 | <section class="card"> |
👇
reduce duplicated contents using…
<product-card
data-header=
data-img=
data-text=with JavaScript!
- customElements : global variable
- shadow, secret // outside world can’t get access to it
- shadow DOM
a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an HTML document in the case of web documents).
※ font-size => DON’T use px !!! USE rem
Progressive Web App (PWA)
- Reliable: download and work off-line
- Service worker (downloads content-heavy web, use off-line)
- Pre-caching
- Fast
- Engaging
- No app store needed
- Immersive full screen
- Push Notifications
- Chrome DevTools : Inspect -> LightHouse ěť´ěš©!!