Search
We need more inclusive web performance metrics
10.7.2020
Scott Jehl argues that performance metrics such as First Contentful Paint and Largest Contentful Paint don’t really capture the full picture of everyone’s experience with websites:
These metrics are often touted as measures of usability or meaning, but they are not necessarily meaningful...
Pseudo-elements in the Web Animations API
14.5.2020
To use the Web Animations API (e.g. el.animate()) you need a reference to a DOM element to target. So, how do you use it on pseudo-elements, which don’t really offer a direct reference? Dan Wilson covers a (newish?) part of the API itself:
const logo...
Phuoc Nguyen’s One Page Wonders
2.5.2020
I keep running across these super useful one page sites, and they keep being by the same person! Like this one with over 100 vanilla JavaScript DOM manipulation recipes, this similar one full of one-liners, and this one with loads of layouts. For that last one, making 91 icons for all those design...
Styling in the Shadow DOM With CSS Shadow Parts
13.4.2020
Safari 13.1 just shipped support for CSS Shadow Parts. That means the ::part() selector is now supported in Chrome, Edge, Opera, Safari, and Firefox. We’ll see why it’s useful, but first a recap on shadow DOM encapsulation…
The benefits of shadow DOM encapsulation
I work at giffgaff where we have...
Collective #593
27.2.2020
Tailwind UI * The Markup * Open Peeps * How does the Virtual DOM work? * Revealing Hero Effect
Collective #593 was written by Pedro Botelho and published on Codrops
Listen to your web pages
16.2.2020
A clever idea from Tom Hicks combining MutationObserver (which can "observe" changes to elements like when their attributes, text, or children change) and the Web Audio API for creating sounds. Plop this code into the console on a page where you'd like to listen to essentially any DOM change...
Bundling JavaScript for Performance: Best Practices
24.1.2020
Performance advice from David Calhoun on how many scripts to load on a page for best performance:
[...] some of your vendor dependencies probably change slower than others. react and react-dom probably change the slowest, and their versions are always paired together, so they...
Thinking Through Styling Options for Web Components
16.1.2020
Where do you put styles in web components?
I'm assuming that we're using the Shadow DOM here as, to me, that's one of the big draws of a web component: a platform thing that is a uniquely powerful thing the platform can do. So this is about defining styles for a web component in a don't-leak-out...
Dip Your Toes Into Hardware With WebMIDI
12.12.2019
Did you know there is a well-supported browser API that allows you to interface with interesting and even custom-built hardware using a mature protocol that predates the web? Let me introduce you to MIDI and the WebMIDI API and show you how it presents a unique opportunity for front-end developers...
How Facebook Avoids Ad Blockers
9.12.2019
Dylan Paulus:
Facebook actually hides 'dummy' DOM nodes between the 'Sponsored' text. These values are entirely random characters, with a random number of DOM nodes between them. Invisible characters. At this point our CSS ad blocker is completely broken. There is no way for us to possibly code...
How We Perform Frontend Testing on StackPath’s Customer Portal
15.11.2019
Nice post from Thomas Ladd about how their front-end team does testing. The list feels like a nice place to be:
TypeScript - A language, but you're essentially getting various testing for free (passing the right arguments and types of variables)
Jest - Unit tests. JavaScript functions are doing...
scrapestack: An API for Scraping Sites
12.11.2019
(This is a sponsored post.)
Not every site has an API to access data from it. Most don't, in fact. If you need to pull that data, one approach is to "scrape" it. That is, load the page in web browser (that you automate), find what you are looking for in the DOM, and take it.
You can do this...
It’s All In the Head: Managing the Document Head of a React Powered Site With React Helmet
30.10.2019
The document head might not be the most glamorous part of a website, but what goes into it is arguably just as important to the success of your website as its user interface. This is, after all, where you tell search engines about your website and integrate it with third-party applications like...
(Why) Some HTML is “optional”
16.9.2019
Remy Sharp digs into the history of the web and describes why the <p> tag doesn’t need to be closed like this:
<p>Paragraphs don’t need to be closed
<p>Pretty weird, huh?
Remy writes:
Pre-DOM, pre-browsers, the world's first browser was being written by Sir...
Some HTML is “Optional”
11.9.2019
There is a variety of HTML that you can just leave out of the source HTML and it's still valid markup.
Doesn't this look weird?
<p>Paragraph one.
<p>Paragraph two.
<p>Paragraph three.
It does to me, but the closing </p> tags are optional. The browser will detect...
Working with Attributes on DOM Elements
30.8.2019
The DOM is just a little weird about some things, and the way you deal with attributes is no exception. There are a number of ways to deal with the attributes on elements. By attributes, I mean things like the id in <div id="cool"></div>. Sometimes you need to set them. Sometimes...
Weekly Platform News: HTML Loading Attribute, the Main ARIA Specifications, and Moving from iFrame to Shadow DOM
15.8.2019
In this week's roundup of platform news, Chrome introduces a new attribute for loading, accessibility specifications for web developers, and the BBC moves visualizations to the Shadow DOM.
Chrome ships the loading attribute
The HTML loading attribute for lazy-loading images and iframes is...
Weekly Platform News: Mozilla’s AV1 Encoder, Samsung One UI CSS, DOM Matches Method
21.6.2019
In this week's weekly roundup, Vimeo and Mozilla partner up on a video encoding format, how to bind instructions to to form fields using aria labels, the DOM has a matching function, and Samsung is working on its own CSS library.
The post Weekly Platform News: Mozilla’s AV1 Encoder, Samsung One...
How to Section Your HTML
18.6.2019
The sectioning elements in HTML5 are <nav>, <aside>, <article>, and <section>. <body> is also kind of a sectioning element since all content lying inside of it is part of the default document section.
Here is a brief explanation of each sectioning element...
Grid, content re-ordering and accessibility
13.6.2019
Take this:
<ol>
<li>Get hungry</li>
<li>Order pizza</li>
<li>Eat pizza</li>
</ol>
That HTML ends up in the DOM that way (and thus how it is is exposed to assistive technology), and by default, those list items are also visually...