1c4aecbeaf
## 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) |
||
---|---|---|
.. | ||
components | ||
pages | ||
styles | ||
.gitignore | ||
package.json | ||
postcss.config.js | ||
README.md | ||
tailwind.config.js |
Tailwind CSS example
This is an example of using Tailwind CSS in a Next.js project.
Deploy your own
Deploy the example using 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:
- postcss-preset-env - Adds stage 2+ features and autoprefixes
To control the generated stylesheet's filesize, this example uses Tailwind CSS' purge
option to remove unused CSS.