WebComponents

251 bookmarks
Newest
Web components don't need a constructor() | Go Make Things
Web components don't need a constructor() | Go Make Things
For years, I’ve written my web component classes with a constructor() method that calls super() to get access to the parent HTMLElement class’s properties… customElements.define('my-awesome-web-component', class extends HTMLElement { constructor () { // Inherit properties super(); // The rest of your code... } }); For my demo projects, I often do all the things in the constructor(). But with Kelp, my UI library for people who love HTML, I’m initializing my in the connectedCallback() method.
·gomakethings.com·
Web components don't need a constructor() | Go Make Things
CSS Parts are saving you from a nightmare
CSS Parts are saving you from a nightmare
Its an amazing foresight that CSS part names are disconnected from the DOM element on which they exist.
·michaelwarren.dev·
CSS Parts are saving you from a nightmare
Bulletproof web component loading
Bulletproof web component loading
Today, I wanted to talk about the “right” way to load web components to ensure they work predictably every time. Let’s dig in! The challenge Web components are self instantiating. Let’s imagine you’re creating a table of contents. When you use a traditional JavaScript library, you explicitly instantiate the library on a specific element. div id="toc"/divconst myTOC = new TableOfContents('#toc'); But with web components, all you need to do is include the custom element associated with the component.
·gomakethings.com·
Bulletproof web component loading
Web Awesome
Web Awesome
Build better with Web Awesome, the open source library of web components from Font Awesome.
·webawesome.com·
Web Awesome
Progressively enhancing forms with an HTML Web Component (part 1)
Progressively enhancing forms with an HTML Web Component (part 1)
Yesterday, I gave an overview of how I approach adding dynamic content to a static, server-rendered website. Today, we’re going to dig into one piece of that puzzle: ajaxy forms. Let’s dig in! Forms FTW! Forms are awesome! With an HTML form, you can support JavaScript-free user iterations. For example, let’s say I want to let users add an item to a list. I can include a form element with a field to add a new item.
·gomakethings.com·
Progressively enhancing forms with an HTML Web Component (part 1)
Web Components - ADG
Web Components - ADG
"Web Components" is an umbrella term for three main technologies: Custom elements, shadow DOM and HTML templates. Using these technologies allows us to create reusable, optionally encapsulated components. There are some important caveats regarding accessibility we need to keep in mind when authoring web components.
·accessibility-developer-guide.com·
Web Components - ADG
Standalone Elements
Standalone Elements
Individual open source web components with zero or few dependencies.
·webcomponents.today·
Standalone Elements
Liskov's Gun: The parallel evolution of React and Web Components
Liskov's Gun: The parallel evolution of React and Web Components
Because this essay is over 11 000 words long(!) I’ve made a convenience EPUB file for offline reading. (EPUB only! No PDF this time.) You can download it over on the fulfilment service I use, Lemon Squeezy, with the option to pay what you want if you feel the urge to support my writing.
·baldurbjarnason.com·
Liskov's Gun: The parallel evolution of React and Web Components
User-defined Web Components
User-defined Web Components
Over the weekend, Remy Sharp asked… Are we at all worried, or even wary, of web component name collisions? The concern here is that if you have a custom element named toggle-tabs, and then important another Web Component that also uses that same custom element name, you’ve now introduced a collision. In the ES import-based JavaScript world, having two functions with the same name isn’t that big of a deal because…
·gomakethings.com·
User-defined Web Components