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

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

🏁

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, 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...

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...