Closed DrizzlyOwl closed 7 years ago
My configuration in Grunt:
purifycss: {
options: {
whitelist: ['.classes-that-i-dont-want-to-erase'],
minify: true
},
target: {
src: ['**/**.php'],
css: ['styles.css'],
dest: 'styles.css'
}
},
Maybe this will give you a starting foundation
There is already a purify setup 💃 .
In package.json
within the tests there is once called tests:css:unused
which runs tools/unused-css-rules.js
Boom!!
Spent some time looking into this and in my present workflow I've got it reading all of the WP theme PHP files and culling all unused css from my stylesheet.
Worth considering? It has a CLI to use in your package.json
https://github.com/purifycss/purifycss#cli-usage