Josh Comeau
March 30th, 2021
New CSS tutorial + my advice for aspiring bloggers
Not already subscribed?
Sign up so you don't miss the next issue!
Josh Comeau

Hey there!

First, a big thank-you to everyone who supported my course launch. Almost 5000 people registered for CSS for JavaScript Developers, more than 10x the number I was expecting. It's been a hectic few weeks, but I'm so very grateful for the support.

I did an AMA on the Indie Hackers forum, sharing some of the launch details. If you're interested in the business side of these things, I hope you'll find it helpful!

More on-topic, though: I've just published a brand-new blog post! It's a tutorial that shows how to build a rich 3D button:

a 3D button is clicked several times

There's a surprising amount of complexity with this, and we'll learn a bunch of generalized cool stuff along the way, from using CSS filters to managing focus outlines across browsers to "character design" and coming up with a personality for our animations. It's built entirely using vanilla HTML and CSS, no JS libraries involved.

I'm really excited to share this one with you! Check it out: “Building a Magical 3D Button”.

Link to this heading
My authoring process

Most of the time, developer blogs wind up with exactly 1 published post: “How I built this blog”.

I think so many of us enjoy the process of setting up a new project, but once we have everything in place, the actual “writing blog posts” part doesn't come as naturally. Everything we can think of already has 10 articles written about it. And writing a blog post feels so much harder than writing code.

This happened to me: the very first version of my blog sat with 1 published post for around a year!

At this point, my current blog has around 80 published posts. I set a goal of publishing 1 new post every 2 weeks, and nobody was more surprised than me when I actually seemed to hit it! Aside from a long stretch in 2020 (when I wasn't able to use a computer due to RSI), I think I've more-or-less kept that pace up for a couple years now.

My blog has been life-changing. It's the main reason I think my recent course launch succeeded. Every week, I get emails from folks asking me to come work for them, on projects that are absolutely tailored for my interests and passions.

In this newsletter, I wanna share a bit about my authoring process. If you're thinking of starting (or restarting) a blog, I hope it's helpful!

Link to this heading
Don't try and brute-force it

When I started blogging, I would create a new Medium post, and stare at a blank page, trying to force my brain to write an article, from the first word to the last.

It was miserable, and it didn't work well. My brain isn't capable of spitting out a cohesive article like that!

I get my best ideas for blog posts when I'm doing other things. I'll come up with a neat idea for an interactive explanation while in the shower. Or maybe a podcast will spark a nifty analogy I can use, while I'm walking down the street.

Inspiration strikes at the weirdest times, and I do my best to capitalize on it. I have an enormous Notion document that includes the notes that I've captured for 100+ potential blog posts.

Here's one example:

A bullet list showing different ideas for a blog post. About 10 bullets total

I was walking down the street on Twitter when I saw a tweet from Wes Bos. It reminded me of an idea that had been kicking around in the back of my head, so I replied with it:

A tweet from Wes Bos asking about stale JS bundles

The response was positive, so I added an entry to Notion for it. Whenever I have a new thought, I add it to the doc. Eventually, this outline will be ready for me to write the article.

The neat thing about this is that I don't really have to spend too much energy trying to figure out what to write. I just keep track of the thoughts I'm already having. When I want to write a new post, I scan this document and pick whichever one I'm most excited about.

I followed this process for the newsletter you're reading now. I knew I wanted to write something about my blogging process, and over the course of a week, my brain naturally collected enough ideas. Then it was just a matter of structuring them and filling in the words.

Link to this heading
Don't worry about being unique

So many developers give up on blogging because they feel like anything they could write about has already been written about.

I used to feel this way too, but an experience changed my perspective.

Let's travel back in time to 2017. React had recently unseated Angular as the most popular front-end framework. This was the height of "JavaScript fatigue", because there was rapid development in tooling and frameworks.

When starting a new React project, it was common to spend hours setting up babel and NPM and webpack and Git and all of the tools needed. People hated how much work this was.

Facebook realized that this was an issue, and they published create-react-app, a tool to help generate fresh React projects. It solved so many of the common headaches. But many people didn't know it existed.

It was bewildering to me, because there were tons of blog posts about how to use create-react-app, but the narrative on Twitter was still “React applications are so complicated to set up!”.

I decided to add 1 more article to the pile. I wrote “Simple React Development in 2017”. It walked through how to use create-react-app to bootstrap a React application. It was the least-unique idea in the world, and it's the most popular blog post I've ever written, even to this day.

Here's what I've come to realize: even if the topic isn't unique, your explanation will be! You might be able to create the resource that will finally help someone understand something they've been struggling with for months.

I used to think that nobody would be able to find my articles, since they'd be buried under a pile of similar articles. But the internet doesn't work that way; if I share something on Twitter, some % of the people who see it will have never seen any of the other articles on the subject.

When it comes to SEO, Google rewards recency. So your newer article might show up ahead of an older alternative.

Link to this heading
Building an audience

Another question I see a lot: “How will I get people to check out my blog?”

A lot of people assume that you need a big audience in order to create a popular blog, but in my experience it's the opposite: a good blog can help you build a large audience!

Granted, it is a slow process. I started blogging on Medium in 2014, and it tooks years before anybody noticed. Here are the first posts I wrote, and the # of views they got:

A table showing blog posts with 20-150 views each

This is actually sort of a good thing though. Writing is a skill, and it takes a lot of practice! I was not at all good when I started out.

After writing dozens and dozens of posts, I got better at it. And as I got better, people started noticing! In 2015 one of my posts made it to the front page of Hacker News and got 24,000 views. By 2016, my posts were averaging a few thousand views each.

Luck is involved. In order to get out there, someone with a large following needs to see and share your content, and that's not something you have direct control over. But you can increase your odds by publishing more content (to increase the chance that someone sees it), and improving as a writer (to increase the chance that someone shares it). Do this for long enough, and the odds will be stacked heavily in your favor.

Link to this heading
Content doesn't have to be long

One last quick tip before I wrap up: a blog post doesn't have to be exhaustive!

Fun fact: the “3D button” post I published this morning was originally part of another post, An Interactive guide to CSS Transitions. I realized that the post had too many elements, and decided to split it into 2 posts.

Often I'll have an idea for a post, but I know that it will require too much explanation / context-setting. So I'll start thinking about how I can write 1 or 2 or 3 "precursor" posts, to build a staircase to the post I want to write.

For my 3D button post, I wanted to be able to assume that the reader was familiar with CSS transitions. So I wrote that post first, and I link to it a couple times from within the 3D button post.

I like this strategy, because it means that advanced readers don't have to wade through all the beginner intro stuff. And beginners have bite-sized pieces of content, instead of one mammoth article that takes hours to get through.

Link to this heading
You don't need to blog if you don't want to

Earlier, I mentioned that blogging has been profoundly helpful in my own career. This is true both in terms of being able to sell my CSS course, but also in terms of straight-up job-hunting.

But I think it's important to point out that you don't have to follow this path. A lot of developers just really don't enjoy writing, and that's OK! Most of the super-talented developers I've worked with didn't have a blog, and their careers are going great.

If you don't enjoy creating blog posts, you'll likely struggle to maintain the willpower to keep writing. Plus, readers can sense when an author's heart isn't in it. If your only motivation is to stay "competitive" with other developers, your blog posts probably won't resonate with people, and you'll really struggle to get any value out of it.

Focus on what you like doing. Employers like to see passion. If you prefer working on interesting technical challenges, do that instead! Focus on the things you enjoy, since that'll be your competitive advantage.

I wrote about how hundreds of developers got their first job in tech, and there was no 1 clear path. Everyone has their own journey. Please don't feel like you have to spend your weekends blogging or coding in order to stay competitive!


PS. One of my favourite kinds of blog posts to write are ones describing how I built something. Are you curious how something works, on my blog or elsewhere? Reply to this email and let me know!