DEV Community

Discussion on: Adding Tailwindcss to my Gatsby website

Collapse
 
regisnut profile image
Regisnut • Edited

indeed, since version 1.4.0 you can add in tailwind.config.JS

module.exports = {
  purge: ["./src/**/*.js", "./src/**/*.jsx", "./src/**/*.ts", "./src/**/*.tsx"],
  theme: {},
  variants: {},
  plugins: [],
}
Enter fullscreen mode Exit fullscreen mode

I didn't try the plugin gatsby-plugin-purgecss, it has to be added in gatsby-config after postcss, and with tailwind: true:

 { 
      resolve: `gatsby-plugin-purgecss`,
      options: {

        tailwind : true, // Enable tailwindcss support

      }
    }
Enter fullscreen mode Exit fullscreen mode