Search

Nalezeno "web components": 64

A Web Component with Different HTML for Desktop and Mobile


Christian Schaefer has a great big write-up about dealing with web advertisements. The whole thing is interesting, first documenting all the challenges that ads present, and then presenting modern solutions to each of them. One code snippet that caught my eye was a simple way to design a component...

lite-youtube-embed


A standard copy-and-paste YouTube embed lands on your page as an <iframe> which loads a big ol' pile of other stuff to play that video. But the UX of it is still essentially an image and a play button. Click the play button and the video plays. You can build essentially the same thing with...

Haunted: Hooks for Web Components


I was just chatting with Dave and he told me about Haunted. It's hooks, but for native web components! Pretty cool. I think the existence of stuff like this makes using web components more and more palatable — particularly in that totally-native no-build-step-needed-at-all kinda way. I...

Why I don’t use web components


Here’s an interesting post by Rich Harris where he’s made a list of some of the problems he’s experienced in the past with web components and why he doesn’t use them today: Given finite resources, time spent on one task means time not spent on another task. Considerable energy has been expended...

Reduced Motion Picture Technique, Take Two


Did you see that neat technique for using the <picture> element with <source media=""> to serve an animated image (or not) based on a prefers-reduced-motion media query? After we shared that in our newsletter, we got an interesting reply from Michael Gale: What about folks who love...

Detect if Element is a Web Component


I’ve advocated for web components since before they became a spec, mostly inspired by the Dojo Toolkit’s dijit framework. Empowering first class JavaScript widgets, as opposed to a mess of DIVs and templates, always made the most sense. Now that web components exist, and awesome...

Making Web Components for Different Contexts


This article isn’t about how to build web components. Caleb Williams already wrote a comprehensive guide about that recently. Let’s talk about how to work with them, what to consider when making them, and how to embrace them in your projects. If you are new to web components, Caleb’s guide is...

Advanced Tooling for Web Components


Over the course of the last four articles in this five-part series, we’ve taken a broad look at the technologies that make up the Web Components standards. First, we looked at how to create HTML templates that could be consumed at a later time. Second, we dove into creating our own custom element....

Encapsulating Style and Structure with Shadow DOM


This is part four of a five-part series discussing the Web Components specifications. In part one, we took a 10,000-foot view of the specifications and what they do. In part two, we set out to build a custom modal dialog and created the HTML template for what would evolve into our very own custom...

Creating a Custom Element from Scratch


In the last article, we got our hands dirty with Web Components by creating an HTML template that is in the document but not rendered until we need it. Next up, we’re going to continue our quest to create a custom element version of the dialog component below which currently only uses...

Crafting Reusable HTML Templates


In our last article, we discussed the Web Components specifications (custom elements, shadow DOM, and HTML templates) at a high-level. In this article, and the three to follow, we will put these technologies to the test and examine them in greater detail and see how we can use them in production...

Collective #500


lax.js * An Introduction to Web Components * Core * Color.review * CSS Grid: Floor Plan * CSS Nesting Module Collective #500 was written by Pedro Botelho and published on Codrops

An Introduction to Web Components


Front-end development moves at a break-neck pace. This is made evident by the myriad articles, tutorials, and Twitter threads bemoaning the state of what once was a fairly simple tech stack. In this article, I’ll discuss why Web Components are a great tool to deliver high-quality user experiences...

Web Standards Meet User-Land: Using CSS-in-JS to Style Custom Elements


The popularity of CSS-in-JS has mostly come from the React community, and indeed many CSS-in-JS libraries are React-specific. However, Emotion, the most popular library in terms of npm downloads, is framework agnostic. Using the shadow DOM is common when creating custom elements, but there’s...

Extracting Text from Content Using HTML Slot, HTML Template and Shadow DOM


Chapter names in books, quotes from a speech, keywords in an article, stats on a report — these are all types of content that could be helpful to isolate and turn into a high-level summary of what's important. For example, have you seen the way Business Insider provides an article's key points...

Styling a Web Component


This confused me for a bit here so I'm writing it out while it's fresh in mind. Just because you're using a web component doesn't mean the styles of it are entirely isolated. You might have content within a web component that is styled normally along with the rest of your website. Like this: See...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace