In this episode, we walk through the process of adding Tailwind CSS to a Nuxt.js project from scratch—doing it all manually for maximum control (instead of relying on pre-built templates or automated integrations).
We start by creating a fresh Nuxt project, running through the usual setup prompts, but specifically not selecting the built-in Tailwind integration—even passing on all the other extra tools—because we want to understand what’s really happening under the hood.
Next, we install Tailwind via npm, organize our CSS in an app.scss
file inside the assets/styles
folder, and wire this up in the Nuxt project's global CSS configuration. Since we’re using SCSS, we also go ahead and add node-sass
and sass-loader
to our development dependencies, ensuring our styles compile smoothly.
Then we generate the needed Tailwind config file—either manually or by running npx tailwind init
—and update the Nuxt configuration to process our styles using PostCSS and the Tailwind plugin. After restarting the dev server, we test if Tailwind is working by tweaking a page background color, confirming the utility classes are live.
We wrap up by doing a quick production build and serve, making sure everything works outside of development too. (Bonus: We briefly mention options for CSS purging, but leave that for you to explore.)
By the end of this video, you’ll know exactly how to set up and troubleshoot Tailwind in any Nuxt project, whether it's brand new or something you’re retrofitting.