JoshWComeau

Josh W Comeau homepage

Articles and Tutorials

The Height Enigma

Unraveling the mystery of percentage-based heights in CSS

One of the most perplexing and befuddling things in CSS for me, for many years, was the behaviour of percentage-based heights. Sometimes, seemingly at random, setting “height: 100%” would have no effect at all. When I finally figured out what was going on, it was like a puzzle piece snapping into place; everything made so much more sense! In this post, I’ll share the epiphany I had, and we’ll explore some solutions.

Read more: The Height Enigma
The Post-Developer Era

When OpenAI released GPT-4 back in March 2023, they kickstarted the AI revolution. The consensus online was that front-end development jobs would be totally eliminated within a year or two.Well, it’s been more than two years since then, and I thought it was worth revisiting some of those early predictions, and seeing if we can glean any insights about where things are headed.

Read more: The Post-Developer Era
A Million Little Secrets

Deconstructing the “Whimsical Animations” landing page

I spent the past few weeks packing as many easter eggs as I could into my latest project, and in this blog post, I want to dig into some of the more interesting details! If you’re interested in animations/interactions, you’ll want to check this one out; I share a bunch of my favourite secrets and tricks. 😄

Read more: A Million Little Secrets
Container Queries Unleashed

Container queries expand the universe of designs that can be implemented, giving us whole new superpowers. Now that container queries are broadly available, I think it’s time we start exploring this potential! In this post, I’ll share the “killer pattern” I can’t stop using in my work, and explore what’s possible with this new capability.

Read more: Container Queries Unleashed
How I Built My Blog

2024 “App Router” Edition

I recently launched a brand new version of this blog, and in this post, I share how it’s built! We’ll examine the tech stack and see how all of the pieces fit together, as well as dig into some of the details to see how they work.

Read more: How I Built My Blog
The Undeniable Utility Of CSS :has

Of all the latest and greatest CSS features, the “:has” pseudo-class wasn’t exactly at the top of my wishlist. Once I started using it, however, I kept discovering incredible things I could do with it. It’s now become a core part of my toolkit! In this blog post, I'll show you some practical real-world problems I solved using “:has”, as well as some wild experiments that blew my mind!

Read more: The Undeniable Utility Of CSS <code>:has</code>
Promises From The Ground Up

The “Promises” API is a surprisingly tricky part of modern JavaScript. Without the right context, it doesn’t make much sense at all! In this tutorial, you’ll build an intuition for how Promises work by getting a deeper understanding of JavaScript and its limitations.

Read more: Promises From The Ground Up
CSS in React Server Components

Understanding the future of CSS-in-JS and React

You can’t make an omelette without cracking a few eggs, and when the core React team unveiled their vision for the future of React, some of my favourite libraries got scrambled 😅. In this blog post, we’re going to explore the compatibility issues between React Server Components and CSS-in-JS libraries like styled-components. You’ll understand what the issue is, what the options are, and what’s on the horizon.

Read more: CSS in React Server Components

Browse By Category

Popular Content

  1. An Interactive Guide to Flexbox
  2. A Modern CSS Reset
  3. An Interactive Guide to CSS Transitions
  4. How To Center a Div
  5. The End of Front-End Development
  6. Designing Beautiful Shadows in CSS
  7. CSS Variables for React Devs
  8. An Interactive Guide to CSS Grid
  9. Why React Re-Renders
  10. Making Sense of React Server Components