Published at
Updated at
Reading time
8min
The Web Weekly newsletter keeps you up to date, teaches you web development tricks and covers all things working in tech.

Guten Tag! Guten Tag! πŸ‘‹

Web Weekly is back after a long and hot summer break. Let me tell you: I'm excited! It was good to take a breather, but I must admit I missed sending out your weekly dose of Frontend goodness.

And in the meantime, Web Weekly passed 5k subscribers. It's wild that so many people read along when I hit "send" later. This tiny side project slowly feels like a "real newsletter".

πŸ’™ Thank you all for reading along, but let's get to it!

Do you know that you can set alternative text for generated CSS content? Or that CSS letter-spacing not only adds space between characters? Or do you struggle with debugging INP and are looking for better tools?

Turn on the Web Weekly tune and find all the answers below. Enjoy!

Cover: stress with the boyfriend.

Marcel listens to "GAFFA GALAKTIKA feat. FLITZMASTERZERO - (TUTTI DILEMMA) - STRESS WITH THE BOYFRIEND"

Punk meets Groove meets House meets πŸ˜΅β€πŸ’« Gaffa Galaktika and her band Tutti Dilemma will take you on a trip where the beat hits hard and the energy level is at max, no matter where you are or whether you want to or not. Their insane sound is just what you need when you are coding for too long again. 🦾

Do you want to share your favorite song with the Web Weekly community? Hit reply; there is one more song left in the queue. 😱

If you're thinking of reimplementing native HTML elements in JavaScript, think twice. Browsers provide a ton of keyboard and accessibility features. Recreating all these tiny details is tough. And I mean really tough!

For example, look at a link β€” a normal <a href="#'> element. Adding a click handler to update a URL with JS is quickly done. That's what a link does, right?

What if I told you that links come with various keyboard accessibility features? And to make it even harder, these vary across browsers and operating systems.

A table showing all the keyboard shortcuts that a browser reacts to on a link.

Eric collected all the keyboard shortcuts that work on a focused link. Did you know you can download a target URL with a few keystrokes? I didn't.

All these link keyboard shortcuts remind me of the subtle difference of button keyboard events fired when pressing ENTER or SPACE.

A native button fires on key down when that key is Enter. If you hold down the Enter key, it continues to fire for as long you hold Enter. A native button fires on key up when that key is Space. If you do not release the Space, the control will not fire.

Isn't it wild that pressing a button with ENTER and SPACE behaves differently?

So, the next time you think of reimplementing native browser functionality, you better have a good reason for it and look at all the details. Browsers provide pretty dang much hidden features.

Something that made me smile this week

The word "Monster" eating a cookie

Let's pretend I didn't play with this cookie monster for five minutes...

Smash the cookies

Open tabs

ECMAScript 2024

// match all emojis except pile of poo const pattern = /\[\p{RGI_Emoji}--\q{πŸ’©}\]/v;  pattern.test('😜') // true pattern.test('πŸ’©') // false

The final version of the next ECMAScript spec was approved, and PaweΕ‚ summarized what you need to know. It includes new regex and promise features, Object.groupBy, and low-level language features.

Write cutting-edge JavaScript today

Toasts are bad UX

Toasts are Bad UX β€” The core problem is that toasts always show up far away from the user's attention.

Max shares a core lesson of good UX: show feedback close to where an action happened. I couldn't pinpoint it before, but this post made me realize what bugs me in the YouTube UI.

Keep the user focused!

letter-spacing works differently than you think it does...

A graphic visualizing that the letter-spacing CSS property doesn't only control the gaps between letters.

What happens if you set letter-spacing: 10px on a headline? There will be 10px of space between the characters. Easy. And that's correct, but there will also be 10px at the outer edge of the last character.

Juan shares some nicely nerdy details about the "simple" CSS property.

Debug the space

Some serious eye candy

A beautiful CSS scroll animation showing scrolling elements with 3d depth

CSS has become such a powerhouse. Here's some serious eye candy from Adam. This carousel uses animation-timeline (Chromium-only right now) to apply this beautiful depth effect.

Go CSS-only!

Chrome will also start shipping new scroll events (scrollSnapChange and scrollSnapChanging) soon.

You're halfway through!

Wowza! Would you enjoy getting Web Weekly straight to your inbox?

The wonderful weird web – Eel Slap

A man looking into the camera

Here's an absolute internet classic: do you wonder how it looks when you slap someone with an eel? You're welcome.

Slap!

CSS tip: :nth-child(2 of .something)

CSS code including :nth-child(2 of .star) syntax

You probably know that you can use :nth-child to match element depending on the position in the DOM. But did you know that you can also sneak in the of keyword?

If that's news to you, Bramus has you covered!

Count your elements

Programmatic copy and pasting

const items = await navigator.clipboard.read();  for (const item of items) {   if (item.types.includes("text/html")) {     const blob = await item.getType("text/html");     const html = await blob.text();     // Do stuff with HTML...   } }

If you interact with the clipboard from JavaScript, the content can be stored with different mime types. There's text/plain, text/html or image/png. But what if you want to copy another type?

Alex goes on a wonderful journey, looking into various copy and pasting methods.

Copy and Paste!

Improved perf dev tools

New devtools showing LCP, CLS and INP metrics.

If you're struggling with improving perf metrics, there's news. Chrome's recent Canary comes with improved tooling, and Umar summarizes everything you need to know.

Debug your perf metrics

How to use inert in React

React only understands known DOM properties, which means React needs to officially add support for inert before you can use the above code. React 19 finally adds support for inert. But chances are you aren’t using React 19, since it hasn’t been released.

The inert HTML attribute went into baseline over a year ago, yet it's not supported in React. But it will be in React 19 β€” if you want to use it today, Mayank describes hacks some workarounds.

Use inert

Random MDN – text-underline-position

text-underline-position demo from MDN.

From the unlimited MDN knowledge archive...

Do you know that there's a text-underline-position CSS property? It accepts auto, from-font, under and even left and right.

Underline

TIL recap – finally

function g() {   try {     throw new Error( 'Foo' );   } catch( e ) {     return 'A';   } finally {     return 'B';   } }  g(); // ???

Trick question: what's the return value of the g function from above? If finally isn't in your daily toolbox, you might be surprised...

Finally understand finally

Find more short web development learnings in my "Today I learned" section.

New on the platform

.new-item::before {/* "black star" & element content is read out */ content: "β˜…"; /* Attribute content & element content is read out */ content: "β˜…" / attr(data-star-alt); /* Custom property & element content is read out */ content: "β˜…" / var(--star-alt);}

With Safari 17.4 and Firefox 128, alternative text for generated CSS content made it into the baseline. And while it's probably still a bit early to use it without fallback, it's a huge step forward for hiding all these Unicode characters from assistive technology. πŸ’ͺ

Set alternatives

Three valuable projects to have a look at

A new Tiny Helper

Whirl β€” CSS loading animations with minimal effort!

If you're looking for good-looking loading spinners, you'll find one on Whirl!

Make the wait pretty

Find more single-purpose online tools on tiny-helpers.dev.

Thought of the week

Eric shared this great definition of different design principles while explaining how to size WCAG-compliant action elements properly.

Responsive Design is about designing for an unknown device. Inclusive Design is about designing for an unknown user.

Did you learn something from this issue?

πŸ’™ If so, join 13 other Web Weekly readers and give back with a small monthly donation on Patreon.

And if GitHub sponsors is more your jam, I just set it up, too. A huge shoutout goes to Simon β€” thank you for supporting Web Weekly via GitHub sponsors!

This is all, friends!

Loved this email? Hated this email? I want to hear about it!

If you think something needs improvement or something sparked some joy, reply to this email because I want to know more!

And with that, take care of yourself - mentally, physically, and emotionally.

I'll see you next week! πŸ‘‹

If you enjoyed this article...

Join 5.5k readers and learn something new every week with Web Weekly.

Web Weekly β€” Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles