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

Staying sane when things get busy

show
Staying sane when things get...
May 15 · General Musings with Kev...
16:24
Spotify Logo
 

I recently went through a period that could have led to burnout, but I managed to avoid it, so I thought I'd share how I managed to get through it.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | RSS

🔗 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.
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,It’s hard not to come back from an event like CSS Day and not be excited about the future of CSS, and the web in general. There is a lot to be concerned about with the current state of things, but one thing that is super clear is that there are still a lot of super passionate people who love their craft, and seeing that passion, both in the talks from other speakers as well as when chatting with attendees, you can’t...

View this email in your browser (or share it with a friend!) Hello Reader, The pattern of shorter newsletters continues for me, as I continue my prep for CSS Day. I’m writing this on Thursday morning (my normal newsletter writing time), and yesterday, as I was rehearsing my talk, I realized I had a pretty big oversight in my talk, so I spent the rest of the day reshuffling things and updating the demos I’m using. It all means it’ll be a stronger talk, but I’ll be on the plane to the...

View this email in your browser (or share it with a friend!) PRE-S: A quick reminder that the State of CSS survey is currently open. The browser vendors all pay a lot of attention to the results of these “State of” surveys, and the more people who take them, the more representative the results are… plus they are a great way to learn about features you didn’t know about! Hello Reader, A bit of a short newsletter this week, as I've been focusing on getting some content created and working on my...