Figma Sites and Your CSS Headscratchers


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 this past week, and they released a no-code builder allowing you to go straight from a Figma design to a live site.

As a front-end developer, hearing that might make your heart sink a little.

There have been other tools that can do Figma → Code, but it’s a bit different when it’s a first-party feature.

On top of that, you can ask their new AI feature to add interactivity and animations!

But it quickly became apparent that there are some issues with the sites that it’s creating.

I was going to write a lot more about it, but I ended up talking about it during a live stream, and I cut that part out to make a single video out of it.

video preview

🤔 Your biggest CSS head scratchers

Last week, I asked people what their biggest CSS head scratchers are at the moment, and I was a little surprised by the theme that emerged:

There is some overlap between things (like debugging and scrolling, for example), and I didn’t include every answer because some were very specific.

Also, there was a question about teaching HTML & CSS, and building a curriculum. If you asked that, I’ve got an answer in the section 😊.

Since overflows and unintended scrolling are such an overwhelming theme, the first thing that comes to mind is when people are over-prescriptive with their layouts, or things within their layouts.

I realize that sometimes, there are pretty complex things at play, but a lot of the time, it comes down to either setting or removing constraints which cause these problems.

There are two ways this can cause overflows:

  • If we declare a fixed size on something, it’s more likely to cause an overflow as the space around it is reduced, since it’s still taking up that fixed size. We’re setting a constraint, which then comes back to bite us.
  • If we do something like width: 0 or min-width: 0, we’re removing a useful constraint that is usually in place that prevents overflows, because now an element can become smaller than the content inside of it. I talked about this more in-depth in this video a few months back.

Sometimes we want things to overflow, but we want to introduce scrollbars, and there are a few issues that can come up when we do that.

The main one is when we use overflow-x or overflow-y: scroll, the other axis is changed to overflow: auto, which can have unintended side-effects.

Dealing with those can be frustrating, and sometimes even takes a reorganization of the DOM, with a few extra divs than you’d planned on using.

Knowing both of these are such a big pain point, though, I am going to think about a bit of extra content around the topics 🙂.


🔌 Shameless plug: I’m super excited to let you know that I’m giving my first-ever in-person workshop later this year! Hosted by Smashing, they’re doing their first ever round of workshops that aren’t directly tied to a conference.

My workshop is titled The New CSS Toolkit, where we’ll be exploring modern CSS techniques that help you write cleaner, more flexible, and more robust styles.

There will be a focus on what’s practical and useful today, with some looks at some exciting features to keep on eye on as well.

It is an in-person only workshop taking place in New York City on June 24th. If you’re interested, you can get more details or register for it here.


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

5 CSS tips every dev should know

video preview

I had a list of some fun ideas, but none of them were really worth making an entire video over, so I made a quick hits video where I look at single-color gradients (including a few use cases for them), user-select, the all property, masks, and taking advantage of containing blocks to be able to escape scroll containers.

Can I survive CSS Hell?

video preview

This was the live stream that I mentioned earlier. The start is when I talk about Figma, but if you’d prefer to jump to the game, go to about ~22:30 (there are timestamps in the video).

⚡ HTML & CSS Tip of the week

This week I take a quick look at the :placeholder-shown pseudo-class, including an interactive example showing what I think is a useful use-case for it.

🎙️ Podcast

It's been a bit of a grind lately

Been having a hard time getting anything done the last few weeks, and as I pull out of it, I talk about some of the issues around productivity culture in general, and how sometimes it seems like we are less productive than we might have realized.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | WEB

🔗 Other awesome stuff around from the web

🏁

As promised, if anyone happens to teach (and I know there are a fair number who follow me who do), my first bit of advice is to try not to worry about teaching everything.

I know the reality of scope-creep and how hard it can be to not add “just one more thing”, and it always feels like so many things are essential to teach, but I’d put my focus on a very strong foundation.

Worry about the 20% of things they’ll use 80-90% of the time.

By taking that approach, there are a lot of things that you won’t cover, but if you covered that 20% well, that means the students understand the core principles, and so when they need to do something you haven’t taught them, it’s not that hard to figure out.

Even with Flexbox and Grid, both of those are big topics, but you can make a lot of layouts using them without going beyond the very basics of either one.

You can’t cover everything, so focus on the absolute most important, foundational parts (while keeping it fun, of course!), and if you do a good job, you’ve set them up for success.

I’d even say that’s more important than covering a lot of topics, as you’re also teaching them to be more independent and figure things out on their own as well.

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, Next week is the last week of school for my kids… which is insane because how did we manage to get this far into the year already?! It also means that I’ll be doing a little less work than usual, as there’ll be a bit more family time, activities, and travels going on, especially through July for me. I’ll still be putting out this newsletter, and I have a backlog of YouTube videos recorded, so the regular stuff will...

View this email in your browser (or share it with a friend!) Hello Reader, Lots of content this week… meaning I was busier than usual and we’re skipping the general musings for this week! 🙋♂️ What I’ve been up to this week Create this trendy blurry glass effect with CSS I didn’t plan for this to coincide with Apple’s new Liquid Glass UI, but I guess the timing was good! It’s not the exact same thing as what Apple’s Liquid Glass, but with the hot mess it is in terms of accessibility, that...

View this email in your browser (or share it with a friend!) PRE-S: The latest State of CSS survey is now open! I’ll be doing a live stream this upcoming Thursday or Friday, going through it myself, but you might as well jump in first! The more people who take this, the more representative it is, and the browsers use the data from these to know what features need improving and what is missing, so it is worth the time to take! Hello Reader, I’ve been getting a lot of comments lately asking...