rsnext/examples/with-tailwindcss
You Nguyen 17d4646a15
Fix warning unknown prettier option when running yarn lint. (#34019)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

---
I'm getting this warning when running `yarn lint` on the local:
![Screen Shot 2022-02-05 at 23 45 57](https://user-images.githubusercontent.com/38455472/152651090-be515630-591a-4602-8bd7-eda71174dfda.png)

After a quick check, it is caused by the `tailwindConfig` option in the `prettier.config.js` file, added in PR #33614
I guess the reason is because the workspace does not install that plugin.

We can safely remove that option in the example, because it's already [the default location](https://github.com/tailwindlabs/prettier-plugin-tailwindcss):

> By default the plugin will look for this file in the same directory as your Prettier configuration file. However, if your Tailwind configuration is somewhere else, you can specify this using the tailwindConfig option in your Prettier configuration.

![Screen Shot 2022-02-06 at 00 12 24](https://user-images.githubusercontent.com/38455472/152651623-86655e80-e8d0-45b1-968c-81b7beed48ea.png)

The warning is gone after removing that option.
2022-02-05 17:13:56 +00:00
..
pages [examples] Add new Tailwind CSS Prettier plugin to example (#33614) 2022-01-24 21:24:48 +00:00
public Bring Tailwind CSS example in line with official Tailwind docs (#19750) 2021-01-25 14:20:14 +01:00
styles Update example for Tailwind v3 (#32339) 2021-12-09 22:42:42 +00:00
.gitignore converted the old tailwind css example to typescript (#32808) 2022-01-05 17:41:25 +00:00
next-env.d.ts converted the old tailwind css example to typescript (#32808) 2022-01-05 17:41:25 +00:00
next.config.js converted the old tailwind css example to typescript (#32808) 2022-01-05 17:41:25 +00:00
package.json [examples] Add new Tailwind CSS Prettier plugin to example (#33614) 2022-01-24 21:24:48 +00:00
postcss.config.js converted the old tailwind css example to typescript (#32808) 2022-01-05 17:41:25 +00:00
prettier.config.js Fix warning unknown prettier option when running yarn lint. (#34019) 2022-02-05 17:13:56 +00:00
README.md Remove extra config from tailwind example (#33062) 2022-01-06 13:58:57 +00:00
tailwind.config.js Update example for Tailwind v3 (#32339) 2021-12-09 22:42:42 +00:00
tsconfig.json converted the old tailwind css example to typescript (#32808) 2022-01-05 17:41:25 +00:00

Next.js + Tailwind CSS Example

This example shows how to use Tailwind CSS (v3.0) with Next.js. It follows the steps outlined in the official Tailwind docs.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

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).