Our industry is being short-sighted


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

Hello Reader,

On the main channel this week, I looked at building errors into your CSS so people know when they're using a component or UI element the wrong way.

It’s a fun concept, but as I mentioned in the video, if you find that a lot of people are misusing something, you should probably ask why that is, and depending on the types of ways they’re misusing things, one solution might be making them more adaptable by providing alternatives that can be conditionally triggered in different ways.

One way we can do this is with style queries, which finally work in every major browser. They let us use a custom property as a setting, and then style things based on it, which means they can act a bit modifier classes, but which are enabled in different ways.

Here, any card that’s inside of that .section will have the horizontal layout. This can be super handy if you work with a CMS, where an option can just set a custom property value, which impacts the layout of the children in there.

But what I like about this is that the setting can come from anywhere. A data attribute, a :has() selector, or a CMS adding an inline style. The horizontal styles are written once, and there are lots of ways to switch them on, with one of my favourites being to conditionally apply them via a media or container query.

We've always been able to modify child elements, but when using descendant selectors, we can run into specificity issues and bloated and complex files. With this approach, we set everything up directly on that element or component and open up some configuration options along the way.

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

🎙️ This is going to backfire

video preview​

Companies are cutting entry-level roles, and it feels like they’re betting AI will fill the gap. But if there are no junior roles right now, what happens in the future?

Well, as I look at in this video, we already have some examples from companies, both small and big, of what happens when there aren’t enough experienced developers, and at least one who’s realized this is a problem they want to get in front of.


📺 CSS can tell you what’s broken

video preview​

Mentioned this at the top, so a quick reminder here in case you wanted to check it out after reading the rest 😊.

🏁

No quiz this week, but I did ask how people got into web development. While most went to school for it, a lot of people got into it through hobby projects and other old-school things like MySpace, Neopets, Geocities, etc. (which is where I got started as well). Lots of great comments on this one, so if you haven't yet, answer the poll here and leave a comment 😊.

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

I'm going to be sending more emails than usual over the next 2 weeks for my Black Friday sale. If you'd prefer not to get them, you can opt out of these sales emails. Hello Reader, Over the last few weeks, I’ve been sharing bits of the new module I’ve been writing for CSS Demystified, and I’m super excited to let you know it’s finally ready! To celebrate, I've made it my Black Friday sale this year, with 32% off until Wednesday, December 2. If you’ve been reading my emails or watching my...

View this email in your browser (or share it with a friend!) Hello Reader, Before we get into this week's content, about an hour before this email was scheduled to be sent, I realized I scheduled it wrong 😅. This one was supposed to go out last week, and I'd already written up another email for this week. So, sorry for missing last weeks email! The What I've been up to this week section has more than usual, since it covers the last couple of weeks. One thing I’m a big fan of is writing robust...

View this email in your browser (or share it with a friend!) Hello Reader, Last week, I said most CSS problems come from a layer underneath the properties themselves. Here's one piece of that layer that almost nobody talks about. The browser creates boxes you never told it to. Take a simple <button class="button">Click me</button> There's one element there. But sometimes, there are two boxes... For example, if I did this: No typo here, this is using the two-keyword syntax for the display...