2

I'm using Laravel Mix with Tailwind CSS included into a theme for Wordpress.

A part of my tailwind config:

 future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  purge: {
    content: [
      '*.php',
      './*.php',
      './*/*.php',
      './purge-templates/*.html',
      './template-parts/*.php',
      './template-parts/**/*.php',
      './resources/*.css',
      './resources/**/*.css',
      './resources/*.js',
      './resources/**/*.js'
    ],
    options: {
      safelist: {
        standard: [/^has-/, /^align/, /^wp-/]
      }
    }
  },  

PurgeCss works fine for all files in the theme folder and in the paths I added but how do I get the classes I used in the content aka gutenberg blocks?
I got between 5-10 pages with content and every single one uses tailwind classes inside.

Do I need to save the content from each one into purge-templates or is there a way to do it automatically?

Thank you

Marek123
  • 1,193
  • 7
  • 35
  • 75
  • I think for those like Gutenberg you might need to add them to the exclude or safelist manually, but you should have most Guttenberg classes on the style file so just including that one to your path might do the trick – Somelight May 26 '21 at 18:03

0 Answers0