Learning to Adapt: CSS & Parenting Parallels


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

Hello Reader,

I have two sons, who are now 10 and 13 years old now (time flies!).

Raising them is surprisingly a lot like writing CSS, where something works when you try it in one situation, only to be frustrated when you try it again somewhere else and it no longer works the same.

Like, I can get one of my kids to clean their room, including doing a great job dusting it and wiping everything down with just a small amount of convincing*, whereas the other one just hides everything in the closet and claims he did a great job.

(*bribery)

It’s a bit like in CSS, where you might feel like if you declare width: 1000px on a selector, anything using that selector should be 1000px wide, only for it to work in some situations but not others!

  • If it’s an inline element, it’ll ignore the declaration completely
  • If it’s a flex item, it might be 1000px wide, but in many situations it won’t be

I talked with Josh Comeau a little while back, and he brought up how one of the things that helps his students “get” CSS is when they realize that when we change layout modes (either through changing the value of the display or position properties), that the algorithm for that element, and potentially it’s children, also changes.

There are all sorts of situations where things change how they work depending on the layout mode being used, like the width example I gave above.

And to make it even more complicated, sometimes those changes impact the element itself (display block vs. inline), and other times, the declaration has a bigger impact on it’s children (display flex and grid).

Add on top of that what I talked about last week, where the user has final control over everything, and that there are tons of unknown variables that we’re having to deal with, and you can quickly see why people get frustrated with CSS.

But building on what I talked about from last week, where I said “Instead of forcing the issue, we need to write code that can adapt to whatever is thrown at it,” when we understand that the algorithm changes when we change layout modes, then we expect there to be differences, which make things a lot easier than expecting it to work one way, and one way only.

Just like raising my kids, the more CSS we write, the more experience we gain, which helps make things easier when we run into problems or are thrown into an unknown situation.

However, sometimes the wheels will come off, and we need to adjust on the fly instead of expecting our pre-existing expectations to hold true in every situation.

As we gain more experience (with both parenting and CSS), we learn that mastery doesn’t come from controlling everything but from building up an intuition for how things might work in any given situation and knowing we might need to adapt.

And also, sometimes all we can do is try something and hope for the best 😆.

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

I had an April Fools video go out on the 1st. It was titled “The Ultimate Guide to Tailwind CSS” and the first minute of the video were the introduction to that, but then “i got distracted” by a new CSS feature that’s being worked on, CSS-only carousels.

If you avoided the video because you thought it was a Tailwind video, or you hadn’t seen it, I’ve cut out the beginning of it, and it’s now just focused on the carousels, which were impressively easy to set up.

video preview

CSS Battle against Andy Bell

video preview

It’s been a long time since I’ve done a CSS Battle, and now that they have a versus mode, it seemed like a great time to do another one!

⚡ Quick tips of the week

🎙️ Podcast

Conferences & Community: A Chat with Henri Helvetica

show
Conferences & Community: A C...
Oct 10 · General Musings with Kev...
58:18
Spotify Logo
 

In this episode I chat with Henri Helvetica, a performance engineer and active member of the web community. We dive into the significance of conferences and meetups, and how COVID-19 has affected in-person events. Henri offers insights on event organizing, the need for new in-person experiences, and what makes a good event. We also explore the value of community and networking, and how to find events and meetups in today's landscape.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | WEB

🔗 Other awesome stuff around from the web

🏁

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 bit of a different email this Sunday, as I don't have any new content to share (which is the first time I haven't had anything in a long time). Instead, I'm writing to let you know on Tuesday and Wednesday of this week, I’m giving a workshop with Frontend Masters called Modern CSS Fundamentals. The workshop is for anyone ready to move from doing their best to getting CSS to work to truly understanding it. Whether...

View this email in your browser (or share it with a friend!) Hello Reader, I’m going to keep the intro short on this ones because there is a lot going on in the What I’ve Been up to section, but before we jump into into that, two quick things: As an experiment for Interop 2026, Jake Archibald and the team at Firefox habe put together a way to gather more feedback on what features matter most to developers. So, if you head on over here, you can pick the proposals that are important to you, and...

View this email in your browser (or share it with a friend!) Hello Reader, A few weeks ago, I posted a video about the current state of the internet after I had a terrible AI-generated CSS article showing up in my news feed. I was saddened by how it was getting priority over quality content from sites like Piccalilli, Smashing Magazine, CSS-Tricks, and countless other excellent sources (I’ve put a bunch in the other links around the web section below if you’re looking for more to follow). At...