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

Are we in a post-expertise era?

show
Are we in a post-expertise e...
May 7 · General Musings with Kev...
14:58
Spotify Logo
 

In this episode, I talk about why being an expert still matters in a world of AI tools, and how those tools can sometimes make us think we know more than we do. I also touch on imposter syndrome and the importance of knowing what we don't know.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | RSS

🔗 Other awesome stuff from around the web

📝 Quiz time!

It's been a long time since I've done a quiz, so it's a bit tricky, but not too hard.

Which of these would NOT center a single child element both vertically and horizontally inside its parent?

  1. .parent { display: grid; place-items: center; }
  2. .parent { display: grid; place-content: center; }
  3. .parent { align-content: center; justify-items: center; }
  4. .parent { display: flex; place-items: center; }

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.
600 1st Ave, Ste 330 PMB 92768, Seattle, WA 98104-2246

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, In the last three days, I’ve created more content than I usually do in one week (and no, don’t worry, I’m not about to try and sell you some productivity system 😆). As I sat down to write this, I wondered what I had done differently to get so much done, and at least some of it was due to a small tweak I made to my workflow on Monday. I won’t bore you with the details, but I want to talk about the idea of removing...

Selfie, standing in front of a canal in Amsterdam

View this email in your browser (or share it with a friend!) Hello Reader, And I’m back from Smashing Conf Amsterdam, where I had an absolutely wonderful time! Amsterdam is such a beautiful city Amsterdam is one of my favourite cities to visit, and Smashing knows how to put on a wonderful conference, so I had high expectations in combining the two, and it didn't disappoint 😊. As for my talk, it went great… and what an amazing venue to speak at! The Pathé Tuschinski theatre As for my talk, the...

View this email in your browser (or share it with a friend!) Hello Reader, I’m writing this from the airport, a few hours into a nine-hour layover. When I booked the flight, I knew this would be a long one, but I have a pile of work to get through, so it’s been a surprisingly productive Saturday. I normally try to avoid working on weekends, but over the last two months, it’s been more the norm than the exception. The launch of CSS Demystified, which just wrapped up, followed by my talk and...