rsnext/examples/with-tailwindcss
2020-05-03 19:45:57 -04:00
..
components Clean up styles in with-tailwindcss example (#12458) 2020-05-03 19:45:57 -04:00
pages Add name to component in with-tailwindcss example (#12417) 2020-05-02 15:08:23 -04:00
styles Clean up styles in with-tailwindcss example (#12458) 2020-05-03 19:45:57 -04:00
package.json Update with-tailwindcss to use Tailwind CSS v1.4.0's new built-in purge option (#12327) 2020-04-30 09:51:37 +02:00
postcss.config.js Update with-tailwindcss to use Tailwind CSS v1.4.0's new built-in purge option (#12327) 2020-04-30 09:51:37 +02:00
README.md Update with-tailwindcss to use Tailwind CSS v1.4.0's new built-in purge option (#12327) 2020-04-30 09:51:37 +02:00
tailwind.config.js Update with-tailwindcss to use Tailwind CSS v1.4.0's new built-in purge option (#12327) 2020-04-30 09:51:37 +02:00

Tailwind CSS example

This is an example of using Tailwind CSS in a Next.js project.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Using create-next-app

Execute create-next-app with npm or Yarn to bootstrap the example:

npm init next-app --example with-tailwindcss with-tailwindcss-app
# or
yarn create next-app --example with-tailwindcss with-tailwindcss-app

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-tailwindcss
cd with-tailwindcss

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Deploy it to the cloud with Vercel (Documentation).

Notes

This example is a basic starting point for using Tailwind CSS with Next.js. It includes the following PostCSS plugins:

To control the generated stylesheet's filesize, this example uses Tailwind CSS' purge option to remove unused CSS.