Next.js garden

18 May, 2020


It supports PostCSS out of the box

  • Install package yarn add -D postcss-preset-env
  • Create a postcss.config.js file to get started
module.exports = { 'postcss-preset-env'] }


  • Install TailwindCSS yarn add -D tailwindcss
  • Create configuration with npx tailwind init
  • Add plugin tailwindcss to PostCSS configuration

Global styles

Create a file pages/_app.js with this code:

import '../styles/index.css'`

export default function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />