Most of us learn CSS backwards


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

Hello Reader,

Have you ever found yourself staring at some CSS that you were sure should work, but it wasn’t doing what you wanted?

If so, welcome to the club 😂.

These days, for me, it’s less about not understanding a specific behavior and more about making dumb mistakes, but there are times when it still catches me off guard as well.

At this stage, most of the time I can reason my way out of the problem I’m facing, but with years of experience in both writing and teaching CSS, it helps me on that front.

I hear a lot of stories from people who say that, even with experience in front-end development, they still second-guess themselves a lot or get stuck on what feel like trivial problems.

From what I can gather, one of the main problems is that people learn CSS backwards.

In other words, we learn the properties and values, and what they do, but not the core principles on which they're built.

At least, that’s what I did way back in the day, and the problems I see people running into are similar to the situations that I’d run into (though they get to do it with Flexbox or Grid instead of layout hacks 😂).

A lot of JavaScript courses and materials cover the fundamental principles of the language before moving on to topics like DOM manipulation, whereas with CSS, we just dive in and start making pages look pretty.

Part of that comes down to CSS not being able to do anything other than make pages look pretty, whereas with JavaScript, we can console.log() our way through some of the foundations first.

But CSS has a lot of fundamentals beyond the box model and the cascade, and understanding those helps unlock better ways of writing it.

For example, while stacking contexts can be a little annoying to work with, most people are aware of them, but a lot of people aren’t aware of formatting contexts and layout modes.

We know things change when we declare a display: flex but many people don’t realize the other changes that can come with those types of changes.

In my interview with Josh Comeau, he said that in his experience, the mindset shift that has things click for most people is when they start seeing it as a collection of different layout modes (that link goes to the timestamp where we’re talking about that).

And another thing that doesn’t get talked about enough are things like containing blocks, which are a big topic when it comes to positioning, as I explore in this video where I look at how you can use position: absolute without running into responsiveness issues.

But talking about these in the abstract is one thing… I’m curious what your current biggest CSS head-scratcher is!

So, if you’ve got something you can’t figure out right now, I’ve set up a one-question form right here (I’m using a form instead of asking you to reply to this email to keep my inbox under control!).

I’m going to read through them all, try to organize them by the “type” of issue that it is, and pull some out as examples to explore in next week’s newsletter.

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

The single most annoying thing about CSS

video preview

There are a lot of annoying things in CSS, but transforms not working on inline elements takes the cake, at least for me.

⚡ Quick tips of the week

🎙️ Podcast

Is shipping broken products the new normal?

In this week's episode of General Musings, I discuss the frustrating trend of shipping broken products, with a focus on Figma Sites and their current shortcomings. I also dive into the topic of AI and the hype surrounding it, as well as the challenges faced in the gaming industry.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | WEB

🔗 Other awesome stuff around from the web
🔌 Shameless Plug

As you might know, my Professional CSS course is on Frontend Masters, and they’ve also added a new Tutorials section to their site where I’m creating 1-2 exclusive tutorials per month for them as well. You can see the content I have with them, plus you get a lot more than just that if you do decide to sign up with them.

You can use the coupon code POWELL to get 25% off your first month.

🏁

Have a fantastic week!
Kevin


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
CSS Hell

View this email in your browser (or share it with a friend!) Very quickly, before we get into the topics of this week's newsletter, the State of Devs survey is going to be closing shortly. The survey is for devs, but asks about who we are, rather than what we know. As with all the "State of..." surveys, the more people who take it, the more representative the results are, so if you have a few minutes, it'd be great if you could take the time to take it. Hello Reader, So, Figma had a big event...

View this email in your browser (or share it with a friend!) Hello Reader, I was going to bury this part lower down, but I think the topic of AI and it’s impact on development is very front-of-mind these days, so I’ve kept it up here at the top. Josh Comeau recently put out an article titled The Post-Developer Era. A listener on my second channel asked for more content where I share my thoughts on articles and news, and Josh's piece seemed like the perfect opportunity to try this approach!...

View this email in your browser (or share it with a friend!) PRE-S: Sending this week’s newsletter out early this week, which I’ll talk about more of why a little further down. Hello Reader, I’m so curious about how some of the new CSS features that are coming out now are going to impact how we author our stylesheets in the years to come. I think the one that might have the biggest singular impact might be the advanced attr() function, which finally allows us to use the values of data...