Building a blog with Next.js and Nx Series

This article is part of a series around building a blog with Nx, Next.js, Tailwind, Storybook and Cypress.

Follow us on Twitter or subscribe to the newsletter to get notified when new articles get published.

 

Table of Contents

It’s important to note that you don’t need to use a preprocessor with Tailwind — you typically write very little CSS on a Tailwind project anyways so using a preprocessor just isn’t as beneficial as it would be in a project where you write a lot of custom CSS.

The official TailwindCSS docs page already has a guide on how to setup Tailwind with Next.js. Definitely check that out.

Install and configure Tailwind in an Nx workspace

The first step is to install the necessary npm packages.

yarn add tailwindcss@latest postcss@latest autoprefixer@latest

The next step is to create the tailwind.config.js as well as postcss.config.js files. Tailwind already comes with a utility for that. Note, previously we generated our app (named site) into the apps folder of Nx. Therefore, when generating the Tailwind configuration, we need to cd into that folder.

#js #tailwind 

Setup Next.js to use Tailwind with Nx
5.75 GEEK