Skip to content
JW

Josh W. Comeau

Interactive deep-dives on CSS, React and animation.

10 articles0 followers#Web Development
JWJosh W. Comeau

Getting Started with Anchor Positioning

For decades, one of the most notoriously challenging problems on the web has been sticking one element to another element, for things like tooltips and nested menus. The CSSWG has decided to provide a first class solution to this problem, and it’s pretty friggin’ cool! In this tutorial, I’ll share the most useful…

Web Development9 min read
JWJosh W. Comeau

CSS vs. JavaScript

There are a bunch of JavaScript animation libraries out there, and you might have wondered whether there’s a performance cost compared to traditional CSS transitions and keyframe animations. In this blog post, we’ll compare the same animation across several different strategies and see the differences firsthand.…

Web Development4 min read
JWJosh W. Comeau

Scroll-Driven Animations

The new Animation Timeline API allows us to create dynamic scroll animations without any JavaScript! It’s honestly a very lovely API, and in this blog post, we’ll explore some of the super cool things we can do with it.

Web Development12 min read
JWJosh W. Comeau

Squash and Stretch

Have you ever heard of Disney’s 12 Basic Principles of Animation? In this tutorial, we’ll explore how we can use the very first principle to create SVG micro interactions that feel way more natural and believable. It’s one of those small things that has a big impact.

Web Development10 min read
JWJosh W. Comeau

Sneaky Header Blocker Trick

There is a lil’ UI detail on this blog. Most people don’t even notice it, but the ones who do often reach out, asking how on earth it works. It feels like it defies the rules of CSS! In this blog post, I’ll break down the surprisingly straightforward implementation so you can start using this trick yourself.

Web Development6 min read
JWJosh W. Comeau

Sprites on the Web

In game development, it’s common to use spritesheets for animation, but this technique isn’t as widely used on the web these days. Which is a shame, because we can do some pretty cool stuff with sprites! In this post, we’ll share the niche CSS function you can use to leverage this technique, and explore some of the…

Web Development7 min read
JWJosh W. Comeau

Brand New Layouts with CSS Subgrid

Subgrid allows us to extend a grid template down through the DOM tree, so that deeply nested elements can participate in the same grid layout. At first glance, I thought this would be a helpful convenience, but it turns out that it’s so much more. Subgrid unlocks exciting new layout possibilities, stuff we couldn’t…

AI & ML19 min read
JWJosh W. Comeau

Springs and Bounces in Native CSS

The “linear()” timing function is a game changer; it allows us to model physics based motion right in vanilla CSS! That said, there are some limitations and quirks to be aware of. I’ve been experimenting with this API for a while now, and in this post, I’ll share all of the tips and tricks I’ve learned for using it…

AI & ML10 min read

The Big Gotcha With @starting-style

CSS has been on fire lately, with tons of great new features. @starting style is an interesting one; it allows us to use CSS transitions for enter animations, something previously reserved for CSS keyframe animations. But is the juice worth the squeeze?

Web Development10 min read

Color Shifting in CSS

A little while ago, I was trying to animate an element’s background color, so that it cycled through the rainbow. Seems easy, but it turns out, browsers have a surprisingly big limitation when it comes to color processing! In this tutorial, we’ll dig into the issue, and I’ll share a couple of strategies you can use…

Web Development7 min read
You're all caught up ✓