rsnext/examples/with-tailwindcss
Shu Uesugi 5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

* Find/Replace "Deploy it to the cloud..." (no colon)

* Find/Replace "Deploy it to the cloud..." for firebase

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

* Update examples/with-stripe-typescript/README.md

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05:00
..
components Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
pages Update with-tailwindcss example (#10141) 2020-01-17 16:02:38 -05:00
styles feat(examples:tailwind): add postcss-preset-env (#10160) 2020-01-20 16:13:18 -05:00
package.json feat(examples:tailwind): add postcss-preset-env (#10160) 2020-01-20 16:13:18 -05:00
postcss.config.js feat(examples:tailwind): add postcss-preset-env (#10160) 2020-01-20 16:13:18 -05:00
README.md Remove Now CLI reference from examples (#10501) 2020-02-12 17:14:57 -05:00

Tailwind CSS example

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

Deploy your own

Deploy the example using ZEIT Now:

Deploy with ZEIT Now

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 ZEIT Now (Documentation).

Notes

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

Limitations

Dynamically generated class strings will be purged

Purgecss takes a very straightforward approach to removing unused CSS. It simply searches an entire file for a string that matches a regular expression. As a result, class strings that are dynamically created in a template using string concatenation will be considered unused and removed from your stylesheet. Tailwind CSS addresses this problem in more detail in their documentation.