next.js template including tailwindcss with typescript
Features
- Includes Tailwindcss
- Includes postcss-preset-env
- now uses tailwindcss 1.4.x purge method on production builds
- uses styled-components with twin.macros to play well with tailwindcss
- stylelint for linting CSS
- typescript-plugin-tw-template for editor support of tailwind classes
- Clone this repo
- yarn install
- yarn dev
styles/index.css The styles/index.css files includes tailwindcss imports and also supports global styles. It is processed by postcss and with postcss-preset-env supports nesting and other cool stuff.
postcss.config.js The configuration file for postcss. The purgecss plugin is configured to scan the *.js files in the pages/ and components/ folder.
tailwind.config.js
You should know that file, its the default config generated with npx tailwindcss init
. It's where your tailwindcss config goes.
pages/_app.js
Here we integrate styles/index.css
into the app.
- Comes with basic vs code config
- Recommended extensions "Tailwind CSS Intellisense" and "stylelint"