Keep browser support simple


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

Hello Reader,

Over the last couple of weeks, I’ve been surprised by how many comments I’ve gotten on YouTube asking how to decide when it’s safe to use a CSS feature, and how to handle browsers that don’t support it.

So, a quick rundown on my thought process:

  1. Is it a progressive enhancement? Something like interpolate-size: allow-keywords is a great example of a time I’ll say yes. Does it really matter if something doesn’t transition to and from a height of auto? As long as it opens and closes, we’re good. (video on interpolate-size)
  2. Can I provide a simple fallback? Say I want to use oklch() for a color, that won’t work in some older browsers, which can be a problem, but I can first declare it using hsl() or hex, and have the oklch() version second (that’s a bit of pain, but tools like PostCSS do that hard work for us).
  3. Am I okay with a slightly different approach? I might want to put something together with grid-lanes, but currently, that’s only properly supported by Safari, so I could use @supports to make a grid or flex fallback version, since it probably needs a bit of a bigger code block (video on @supports).

And then sometimes I decide it’s not worth it and skip a feature. For example, something like @scope is cool, but the CSS inside of it won’t work unless the browser supports it, and the complexity of a fallback would be too much, so I just use a different approach and wait until it has better support for another project in the future.

A few important notes: It’s important to know your audience! I feel pretty safe shipping things that are Baseline Widely Available on my site, and even my course platform, because my audience is made up of developers who are generally on more up-to-date devices than the general public.

For some, Baseline Widely Available means nothing, and they just worry about what version of iOS a feature shipped with instead, and have a specific cutoff based on that.

Also, be careful if you’re using a lot of AI to write CSS for you. I’ve noticed that Sonnet seems to be a bit out of date with what CSS can do, to the point where it’ll suggest JS for things that have pretty well-known and supported CSS solutions, while Opus likes to use some cutting-edge stuff that doesn’t always have the best support, without warning you about it.

There are skills like Google’s Modern Web Guidance, but it’s heavily reliant on Baseline status, which, as I said, isn’t always a great cutoff, depending on your project and audience.

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

📺 CSS animations to bring your site to life

video preview​

A few months ago, I looked at adding life to a landing page with GSAP. In that video, there was a section I skipped because all the animations I did there were CSS-only, and so I finally got around to exploring how I made that section.


⚡ Front-end fast money with Adam Argyle

video preview​

A quick-fire round with Adam Argyle where the answers have to come fast.


🎙️ You can’t escape CSS architecture

video preview​

A conversation with Michael Warren (who I’ve teamed up with to work on a design systems course) where we talk about StyleX and CSS-in-JS solutions in general, and the importance of architecture, scoping, and the balance between JS and CSS for creating maintainable and scalable stylesheets and design systems.

📝 Quiz time!

An element uses animation-timeline: view(). Which animation-range keyword makes the animation finish just as the element is fully on screen?

  • contain
  • cover
  • entry
  • exit

As usual, you'll have to head on over to YouTube to take a stab at the quiz, and once you answer, you'll see if you were right or not.

​

Have a fantastic week!
Kevin

P.S. Random question, but do you play chess online? If so, I’ve got a quick questionnaire I’d really appreciate you filling out if you have a few minutes to spare.


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

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