What if you suddenly couldn't type anymore?


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

Hello Reader,

Today's newsletter is a bit of a different format.

First up is a video I put out this week because I think it's one of the most important videos I've ever put on my channel.

That's followed up by a story of how I got nerd-sniped by a perfectly fine solution to a problem I wanted to try and improve on, before we get back into the regular format.

What if you suddenly couldn't type anymore?

video preview

Salma Alam-Naylor, who you might know as whitep4nth3r on Twitch, recently developed excruciating pain and pins and needles in her hands.

This made it very difficult for her to type, and to start healing, she had to stop using her keyboard.

As a software engineer, that isn't exactly easy to do.

She was kind enough to join me so we could all learn more about what it's been like for her, and some of the tools she's been learning to use to continue writing code.

She also wrote an article about how she learned to code with her voice that I'd encourage you to read as well.

🤓 I got nerd-sniped

A nice thing about being a content creator with a very narrow focus is when I get nerd-sniped by something, I can justify spending way too much time going down that rabbit hole 😆.

This happened to me this week when Matt Perry shared a new effect that was added to the Motion examples.

In his post, he highlighted the importance of using aria-hidden for the duplicate text used to make this, which got me to start thinking about a way to do it without duplicating the text.

If you’re using a framework and turn the elements into a component, you can pass the text as a prop and having duplicate text is no big deal, but damn it, I want to do it with vanilla HTML and without writing content twice!

My first attempt was using an animation to do it.

I was able to get this to work, but it had a problem: when we use a keyframes animation on an element, it will fire when the page loads, which I didn’t want.

In a way, I felt like it was “good enough” because it mostly worked, even if it wasn't quite right.

Then Temani Afif came in with a suggestion I wish I’d thought of: using a text-shadow!

This was nearly perfect!

With text-shadow, we can offset it without a blur. It’s everything I wanted, and was very simple to implement…

So, why is it nearly perfect? When the text moves off, we can still select it, but we don’t see the ::selection, which is kind of awkward.

Now, for a navigation menu like this, that really doesn’t matter because why would someone be selecting the text?

No one would, problem solved!

Except it still bugged me 😆.

I poked and prodded at it the next day, until I finally remembered that I could use both transform: translate and the individual translate property individually from one another!

The trick is delaying the translate for half the transition-duration, and having it happen instantly, with a transition-duration: 0ms.

You can find the finished version here if you want to poke around with it.

And yes, I will be making a YouTube video on this eventually, but it’ll probably be at least a month, but I was happy with how it turned out and wanted to share it 😁.

🙋‍♂️ What I’ve been up to this week

Create a super fun “focus by negation” effect

video preview

Adam Argyle posted a cool effect on his blog recently. It’s not exactly practical in it’s final form, but the earlier stages of it could be useful, and there is a lot to learn in going all-in with it.

I took a bit of a different approach with this video, showing how I learn something from a tutorial or blog post.

I had an idea of how it worked, but I didn’t know all the details, so I did my best, and then would explore his code to see why things might have been going wrong. I hope you like this style!

Shorts of the week

HTML & CSS Tip of the Week

Container query units: cqi and cqb

Container queries made a lot of noise when they came out. While not everyone is using them yet, most people at least seem to be aware that they exist.

Somehow, the new (awesome) units that we got with them seem to have gone more under the radar.

🎙️ Podcast

Navigating CSS Layout Decisions

Inspired by recent articles from Andy Bell and Alex Riviere (linked in the links section below), I explore a bit of my own decision-making process when deciding between Flexbox and Grid.

This leads to me talking about intrinsic and content-first layouts as well, and how the most important thing is that we're thinking about the decisions that we're making.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | WEB

🔗 Other awesome stuff around from the web

🏁

The nerd-sniped section of this email was quite different from what I usually share in these, as I tend to save the more technical stuff for videos, I hope that you enjoyed it 🙂.

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)

Conquering Responsive Layout

A free course to help you approach responsive layouts with the right mindset.

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 →

Advanced

Beyond CSS

An advanced course that dives into project architecture, theming, design systems, and more.

Enroll →

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, Last week, I talked about how CSS is like a strange puzzle. Like a regular puzzle, when we write CSS, we need to figure out how to fit all the pieces together properly. But it’s made more complicated because each piece can change it’s size and position. Despite that, we still need everything to fit together. There are so many variables at play at any given time that it sometimes feels like we’re just hoping for the...

View this email in your browser (or share it with a friend!) Hello Reader, A few weeks ago, my dad and my 10-year-old son were working on a puzzle together. My dad mentioned that it was a pretty hard puzzle for a kid, and he was impressed with my son's patience with it (he isn’t always the most patient type 😆). The reason I bring this up at all is because one of the reasons that I often tell people I like CSS is because it’s like a puzzle. Just like with a real puzzle, where you do have a...

Flexbox Simplified

View this email in your browser (or share it with a friend!) Hello Reader, Another shorter email than usual this week. We’ll be back to the regular ones starting next week 🙂. 🙋♂️ What I’ve been up to this week Create a fun, quick text flip effect Not sure about the name and thumbnail that I made for this one, as the text doesn’t flip, so much as, slide in and out. I don’t know what else to call this effect, or how to make a good thumbnail to illustrate what's going on, so this is it 😆. I took...