rsnext/examples/with-tailwindcss
Luis Alvarez D 63ea2d8297
Add CSS Modules examples to docs (#15601)
Fixes https://github.com/vercel/next.js/issues/15595

- Updated the tailwindcss and tailwindcss-emotion examples to the latest version of tailwindcss
- Added a new `with-styled-jsx` example
- Updated the `basic-css` example to use CSS Modules instead of styled-jsx
- Added the examples to the documentation page for built-in css support
2020-07-29 14:43:48 +00:00
..
components Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
pages Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00:00
styles Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
package.json Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00:00
postcss.config.js Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00:00
README.md Suggest npx over npm init (#13637) 2020-06-01 17:36:57 +00:00
tailwind.config.js Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00: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:

npx create-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/vercel/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.