rsnext/examples/with-tailwindcss
Henrik Wenz 1c4aecbeaf
Improve with-tailwindcss example (#17742)
## Change

To opt-in to using the new layers mode by default.

## Motivation

- Reduces CSS filesize
- Prevents users from using the already deprecated old layers mode
- Removes the following console warnings:

```log
risk - There are upcoming breaking changes: purgeLayersByDefault
risk - We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future.
risk - https://tailwindcss.com/docs/upcoming-changes
```

[more info](https://tailwindcss.com/docs/upcoming-changes)
2020-10-12 16:37:56 +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 Fix a small typo in index.css (#17399) 2020-09-27 22:17:03 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
package.json Update with-tailwindcss example (#16370) 2020-08-27 23:54:12 +00:00
postcss.config.js Add CSS Modules examples to docs (#15601) 2020-07-29 14:43:48 +00:00
README.md Simplify example usage instructions (#16678) 2020-08-29 22:22:02 -04:00
tailwind.config.js Improve with-tailwindcss example (#17742) 2020-10-12 16:37:56 +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

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

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.