@@ -43,13 +43,8 @@ Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&ut
...
@@ -43,13 +43,8 @@ Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&ut
## Notes
## Notes
This setup is a basic starting point for using [Tailwind CSS](https://tailwindcss.com) with Next.js. This example also includes the following [PostCSS](https://github.com/postcss/postcss) plugins:
This example is a basic starting point for using [Tailwind CSS](https://tailwindcss.com) with Next.js. It includes the following [PostCSS](https://github.com/postcss/postcss) plugins:
-[postcss-preset-env](https://preset-env.cssdb.org/) - Adds stage 2+ features and autoprefixes
-[postcss-preset-env](https://preset-env.cssdb.org/) - Adds stage 2+ features and autoprefixes
To control the generated stylesheet's filesize, this example uses Tailwind CSS' [`purge` option](https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css) to remove unused CSS.
### 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](https://tailwindcss.com/docs/controlling-file-size#writing-purgeable-html).