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

When the passion starts to fade

show
When the passion starts to f...
Jan 23 · General Musings with Kev...
18:17
Spotify Logo
 

This week, I start by talking about how my son wants to give up on a new hobby, and make my way into how AI is disillusioning developers.

LISTEN ON: APPLE | SPOTIFY | YOUTUBE | RSS

🔗 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)

HTML & CSS for Absolute Beginners

A free course that starts with the absolute basics, and gets to creating some layouts with Flexbox and Grid.

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 →

Intermediate (Frontend Masters)

Build a Modern Site from Scratch

Build a fully responsive site using modern CSS features, along with some polished animations.

Enroll → (25% off first month of Frontend Masters if you use this affiliate link)

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

Hello Reader, First off, I completely forgot to send this newsletter last week, so this week’s has all my content from the past two weeks. As for the main topic of this week, after eight years, I’ve finally redesigned my homepage. For someone who talks about CSS all the time, I was a little embarrassed that I hadn’t redesigned it sooner. I think the old design was fine, and aged pretty well, but it wasn’t really anything great either. The new one is a bit more of a minimal approach, but where...

View this email in your browser (or share it with a friend!) Hello Reader, First off, thanks to everyone who let me know my emails were being flagged as phishing. Apparently, Gmail (and maybe some others?) started flagging YouTube’s shortened links, which are the ones they give creators to copy/paste quickly… Gotta love big companies flagging their own shortened URLs, but whatever, hopefully this one gets through without any issue! As for the topic of this email, it’s become a tradition for...

View this email in your browser (or share it with a friend!) Hello Reader, Before we dive into the content of this one, I want to let you know that this will be the last newsletter of the year, and I’ll be back in your inboxes sometime in mid-January. I’ll still have YouTube videos coming out, so you can keep an eye out over there by making sure you’re subscribed (only like 4,000 away from 1 million!). I’ll also do a quick roundup of all the content I put out once the newsletter resumes. With...