As featured in Gatsby's community plugins.
A Gatsby post-build plugin that implements PurifyCSS.
Never worry about the size of your css framework again!
Updates your html files directly, removing any unused inline styles.
$ npm install gatsby-plugin-purify-css
In your gatsby-config.js
file:
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-purify-css',
options: {
/* Defaults */
styleId: 'gatsby-inlined-css',
purifyOptions: {
info: true,
minify: true
}
}
}
]
}
PurifyCSS options are documented here.