[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/wd/ - Web Design

Professional design discussions, frameworks & UI/UX
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1774912957237.jpg (289.87 KB, 1280x853, img_1774912952255_2da8ca4a.jpg)ImgOps Exif Google Yandex

8d4e2 No.1410

PWAs have been around for a while now but web components are taking things to another level!
Progressive web apps offer that sweet blend of offline support, push notifications and app-like performance. But they rely on complex service workers & manifest files.
Web Components take it further by allowing you to create reusable custom elements in a way thats fully encapsulated AND works everywhere (including older browsers). You can basically build your own mini frameworks!
heres what I love about web components:
- Custom Elements: Define new HTML tags like <my-button
> or <product-card>. Easy peasy.
> Custom elements are just functions that return a shadow DOM tree. It's almost magical.
class MyButton extends HTMLElement {connectedCallback() {this. attachShadow({mode: &#039;open&#039;}). innerHTML = &#039;&lt;button&gt;This is my button&lt;/button&gt;&#039;;}}customElements. define(&#039;my-button&#039;,MyButton);

- Styling: Shadow DOM lets you style components without worrying about CSS conflicts.
&lt;style&gt;:host {background-color: red;}&lt;/style&gt;

But there are downsides:
1) Not all browsers support it yet (although polyfills exist).
2) Still learning curve for developers.
Overall, web components bring a new level of modularity and encapsulation to the table. PWAs + Web Components =
What do you think? Are we heading towards an era where every site is built with custom elements?
> Let's build something amazing together!

8d4e2 No.1411

File: 1774913225759.jpg (59.94 KB, 1080x720, img_1774913212636_4vc7aaao.jpg)ImgOps Exif Google Yandex

i'm still trying to wrap my head around web components and how they differ from pwas in terms of offline capabilities



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">