Skip to content

Christopher Bennell

I build web stuff. Full Stack/Platform Engineering/Architecture. Senior Software Engineer.

Lab / Vapour: A Ghost CMS Theme for Vite & TailwindCSS

Vapour: A Ghost CMS Theme for Vite & TailwindCSS

When I started building a theme for my Ghost site, I wanted all the benefits of a modern front-end tool set. For me, that meant Vite and TailwindCSS (although I ended up ditching Tailwind halfway through). It turns out there are some hoops to jump through to get a good experience using Vite with Ghost. I thought it would be worthwhile sharing my solutions, so I packaged them as a standalone Ghost theme: Vapour.

(Keep in mind, Vapour has a functional but unadorned visual style, but the point is that it is a starting point for using the Ghost + Vite + Tailwind workflow, meant to be customized with your own design.)

There are a few problems we need to solve when using Vite with Ghost:

This setup provides hot module replacement and automatic reloads (even on changes to your Handlebars files)

A note about cache busting: Ghost handles asset version automatically using the {{asset}} helper, so we don’t need to use Vite’s fingerprinted filenames; we could just output static assets and skip the whole manifest-scanning-partial-generation thing. But I like the flexibility it grants: we can load whatever Vite outputs without modifying our templates manually.

We get full Tailwind support, PrismJS code syntax hightlighting (if you’re into that kind of thing) and a GitHub deploy action to update your production site automatically.

Check it out, kick the tires, let me know what you think.