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! ๐Ÿ‘‹

Do you style the ::target-text pseudo-element? Do you use modern Git commands? And do you know how SVG paths really work?

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

Paweล‚ listens to "Burt Bacharach - What The World Needs Now Is Love" and says:

There is millions of versions of this beautiful song out there, but this one by Burt Bacharach is by far my favorite. I like it a lot more than the most popular version of this tune sung by Jackie DeShannon (although this one is also incredible).

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

If you enjoy Web Weekly, share it with your friends and family.

A quick "repost" really helps this indie newsletter out. Thank you! โค๏ธ

Something that made me smile this week

A visible cloud. An elephant image will be drawn on top of it.

Suppose you're a person who likes looking into the sky discovering shapes and animals in the clouds, then you'll love cloudgazing.online. It's a platform (and community) to draw things in the clouds.

Look at the clouds

No code

Understand "Big O" notation

A comic dog thinking "The O(1) line is always at 20 in that graph, so why don't we say O(20) instead?"

I heard about the Big O notation in university for the first time. While useful, I rarely come across it in daily life. However, if you want to learn what it's about and how you can optimize your method performance, Sam does a wonderful job explaining the complicated topic.

Optimize the Big O

TIL from the post; do you know that you can sum the numbers going from 1 to n with a simple formula: (n*(n+1))/2? Wild!

Git restore and switch

The modern equivalents of git checkout, known as git switch and git restore have been considered experimental since their introduction back in Git 2.23. Six years later, the commands are no longer considered experimental.

Call me old school, but I still use Git from the command line. I still remember how confused I was when I started using it. The most confusing command was git checkout because it handles files and branches. What the heck?

Modern Git versions support git restore and git switch and the new commands are now considered not experimental anymore.

Does this mean I've stopped using git checkout? What should I say; I tried but things are hard to unlearn.

Some fancy SVG filters

Geometrical figures whose corners will be rounded when clicking "apply rounded corners".

Do you know that you can round an element's corners using SVG filters? Or use them to create natural drop shadows? Or apply an eye-catching dithering effect?

I started collecting SVG filters a while ago. If you know of any more fancy ones, I'd love to add them to the small collection.

Use SVG filters

Scroll spies without JavaScript

A table of contents component highlighting the currently visible section

Here's a bit of future music. Una shared that soon, with Chromium 140, we can implement CSS-only scroll spies. This means that we can highlight links in table of contents components depending on which container is currently visible by using scroll-target-group: auto; and the new pseudo-class :target-current. And theoretically, all this should work without JavaScript. Whoop whoop!

However, there's a catch... ๐Ÿ‘‡

If you want to use this feature as a progressive CSS enhancement today, keep in mind that you will need to use JS to add aria-current to the active anchor when its corresponding target scrolls into view, otherwise you risk an instant WCAG 1.3.1 violation.

Sara had a look at the new scroll-target-group and recommends to still use JavaScript to make the CSS-only spies more accessible.

You're halfway through!

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

The wonderful weird web โ€“ Purrli

Purrli โ€” The internet has a cat

I have the slight feeling that I included Purrli last year, but it crossed my path again. If you're a cat person, you'll enjoy this internet cat!

Be comfy

I love the PPM metric (purrs per minute). ๐Ÿ˜…

TypeScript 5.9 is out!

Announcing TypeScript 5.9

The new TypeScript version comes with import defer, new init settings and... drum rolls... a new preview feature called "expandable hovers". If you've ever cursed TypeScript for only showing a type or interface in your editor without giving info on what it includes, this issue hopefully will be resolved.

Check the new version

Responsive CSS layout magic

A preview window rendering multiple complex CSS layouts depending on the container width.

Ahmad shared how to create multiple complex layouts with modern CSS and the post is quite a banger because it explains grid areas (grid-template-areas), style queries (style(--featured: true)), the :has() selector, and container queries. Highly recommended!

Use all the good stuff!

Side note: be aware that style queries aren't supported in every browser yet.

SVG paths explained

A tool showing how to alter a bezier svg curve.

Josh came around with another interactive article explaining SVG primitives. It's about SVG paths. Make sure to turn on sounds because otherwise you'll be missing out!

Understand all these numbers

CSS random()

.star {    width: random(2px, 10px, 1px);    position: fixed;    top: random(0%, 100%);    left: random(0%, 100%);  }

Disclaimer; CSS random() is very much future music. There's no MDN page and no caniuse.com entry yet. But there's a post on the Webkit blog! And while use cases for random CSS values are definitely niche, I'm super excited about them!

Roll the dice

Random MDN โ€“ ::target-text

::target-text {   background-color: pink; }

From the unlimited MDN knowledge archive...

Did you know there's a ::target-text pseudo-element that works in all browser engines? Now you do!

Target the text

TIL recap โ€“ "hide" JS properties with symbols

const lastTouched = Symbol('lastTouched');  const record = {   name: 'schnitzel'   // use a symbol as a property key to hide the    // property from "standard" object operations   [lastTouched]: 'right now', };

If you're long enough in the game you might remember the good old _private property naming convention. JS properties starting with an underscore were considered implementation details and shouldn't be used from the outside. Of course, this approach didn't really forbid to use or read these properties. What if I told you that you can use JS symbols to hide your internal properties?

Hide the internals

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

Soon on the baseline

const pattern2 = new URLPattern({ pathname: "/books/:id(\\d+)" }); console.log(pattern2.test("https://example.com/books/123")); // true console.log(pattern2.test("https://example.com/books/abc")); // false

Firefox 142 now ships with the URL Pattern API. And while it's not on the baseline yet, it's already included in Safari 26. There's also a Polyfill available. If you're wrangling regular expressions to match URL patterns you should check it out!

Match it!

Three valuable projects to have a look at

A new Tiny Helper

Hyvector graphic with svg editing dots layered on top of it.

Suppose you're looking for a quick'n'easy and login-free tool to edit SVG paths, Hyvector might be the tool for the job.

Edit online

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

Thought of the week

I think Ben is more than right with this take. ๐Ÿ‘‡

"I don't like CSS" is coded speech for "I never learned CSS".

Did you learn something from this issue?

โค๏ธ If so, join 25 other Web Weekly supporters, earn some karma points and give back with a small monthly donation on Patreon or 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 6.1k 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