How to configure PostCSS/PurgeCSS with hugo to save classes for disabled elements?
html code example: <a href="..." disabled>
postcss.config.js
:
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [ './hugo_stats.json' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
}
});
module.exports = {
plugins: [
...( [ purgecss ] )
]
};
config.yaml
:
build:
# Used by PurgeCSS
writeStats: true
In my case all [disabled]
classes (like a[disabled]
) are removed after PurgeCSS.
How to fix it?