My favorite new CSS feature


View this email in your browser (or share it with a friend!)

Hello Reader,

It’s hard to pick one thing because there is so much to pick from right now, but I think my favorite new CSS feature is anchor positioning.

Check out this navigation that I’ve put together for a project I’m working on, where the underline and link highlight is all from a single pseudo-element.

video preview

That’s all done with something like 20 lines of CSS!

And, with a handful more, I created a decent fallback for browsers that don’t support it yet, that while not as fancy, I think it does a good enough job as a fallback.

video preview

If you’re curious on how I did it, I don’t have a breakdown of this one (yet), but it’s quite similar to what I looked at in this video a little while ago, with the big difference being a couple of delays in the transitions.

video preview

And it’s only getting better from here, with Chrome having recently shipped the ability to detect which fallback you are using (if you are using them), so you can make further adjustments, which is great for things like tooltips.

There’s a lot of other great things that are coming as well, but I think anchor positioning is going to be a bit like :has(), gaining a lot of usage quite quickly as it’s support increases, because it’s easy to use (though it definitely has it’s quirks!) and is useful for so many different things.

📺 3 Powerful nesting tricks

video preview

Following up from last week’s video where I looked at the basics of nesting, this week I take a look at what we can do when we get a little more creative with how it works.

⚡ Simplified modifier classes with this CSS trick

video preview

A quick look at how we can use attribute selectors for modifier classes. This has the potential to clash with other classes, so you do need to be careful with it 🙂.

🎙️ Podcast

Modern CSS quick hits

show
Some recent insights on what...
Dec 12 · General Musings with Kev...
18:26
Spotify Logo
 

In this episode I share some insights from a recent workshop with Smashing, discussing the adoption and support of CSS features like 'has', 'subgrid', and 'container queries', and how I was surprised by the awareness and usage of some features.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | RSS

🔗 Other awesome stuff from around the web

📝 Quiz time!

Which of these selectors would select the element that comes directly BEFORE an element with a class of “avatar”?

  1. :before(.avatar)
  2. :has(+ .avatar)
  3. .avatar + .avatar
  4. There is no way to select something that comes before another element with CSS

As per usual, you'll have to head on over to YouTube to take a stab at the quiz, and once you answer, you'll see if you were right or not.

🏁

Have a fantastic week!
Kevin


Are you looking to step up your CSS? I've got both free and premium courses to help with that! They cover a range of skill levels too 👇

Beginner friendly (and free)

HTML & CSS for Absolute Beginners

A free course that starts with the absolute basics, and gets to creating some layouts with Flexbox and Grid.

Enroll →

Intermediate

CSS Demystified

For those who've been writing CSS for a little bit now, but want to step up their game and start writing CSS with confidence!

Enroll →

Intermediate (Frontend Masters)

Build a Modern Site from Scratch

Build a fully responsive site using modern CSS features, along with some polished animations.

Enroll → (25% off first month of Frontend Masters if you use this affiliate link)

If you no longer want to get any emails from me, you can unsubscribe or you can edit your preferences if you'd like pick which emails you get from me.
113 Cherry St #92768, Seattle, WA 98104-2205

Hi! I'm Kevin

Weekly newsletter, where I talk about tangentially-related front-end development topics and share what I've been up to in the last week, plus any cool/fun/interesting/useful links I come across as well.

Read more from Hi! I'm Kevin

View this email in your browser (or share it with a friend!) Hello Reader, A very short email this week, with a little less content than usual. Between the Black Friday Sale, my Smashing workshop, and a few other things, it’s been pretty hectic! Luckily I knew this was all coming and made some regular content for all of December already 😅. 🙋♂️ What I’ve been up to this week Getting started with CSS Nesting CSS Nesting is awesome, though there are a few important things to know about it, which...

View this email in your browser (or share it with a friend!) Hello Reader, I hope all of my American readers had a fantastic Thanksgiving, and everyone else is having a nice weekend 😊. Every year, when we hit December (which is tomorrow!), I realize the end of the year is almost here and wonder how the heck it went so quickly! It always feels like there's still so much to do, and while I’ll be doing a proper year-in-review once we actually hit 2026, taking a quick stock of what I’ve done this...

View this email in your browser (or share it with a friend!) Hello Reader, My Black Friday sale kicks off today, and it's a big one: 40% off of CSS Demystified and Beyond CSS. Being the first non-launch-related sale I've ever done, I figured to make it a big one, so on top of that, I'm also throwing in Flexbox Simplified as a bonus with either one. The sale runs today, up through the end of the day on December 1st. As for the two courses that are on sale: CSS Demystified is for people who've...