Is your feature request related to a problem? Please describe.
Yes, I want to create SSR html file with inline purged CSS but afterwards lazily load leftovers of css
Describe the solution you'd like
I want purgecss to output css that was excluded from output file ( original css without purged css)
Describe alternatives you've considered
Find a multi platform reverse diff solution, but haven't found one
I was rethinking the whole idea. If you can get an array of classnames which was rejected.
Maybe if there would be some kind of configuration like 'ignore: [array]' so scanned classes would be automatically ignored and not included in purged file
I think both options would be a good Idea, one would be to take all the css that gets purged and optionally output a seperate css file with all of those.
Your second suggestion would be to "blacklist" some styles so that they get purged even if the extractor finds something that would match it right?
I think the name "blacklist" would be good because we already have a options called "whitelist".
I approve this request.
PurgeCSS is awesome to limit the size of the final files but telling us wich selectors have been purged would be a really interesting info to clean stylesheets.
I use webpack to launch PurgeCSS and a simple output in the terminal during the build could be a good start !
I would really like this feature too, but for the purpose of cleaning up the original scss files. Output to the terminal or a file would allow me to delete classes or add to a whitelist until there was nothing left to be purged.
+1
There already is the rejected option (https://www.purgecss.com/configuration) which seems to do this. But it doesn't work with the webpack plugin afaik.
Same here with Gulp. Don't know what should I do after setting rejected: true 🤷♂️
Same here, rejected: true does nothing using CLI with a config file. 😞
the option rejected: true only tells purgecss to collect all the rejected selectors, its only available if you use the node API. The gulp plugin and the CLI don't yet have the feature to output the rejected selectors. We will try to get to it but if you feel like creating a PR, that would be very helpful.
I would also like to see this, the unused CSS output to another file. Is that feature available yet? Last update here was almost a year ago. What does it mean this is available in the node API. How do I use that? I am using Gulp. Thank you
+1
+1 for gulp please
gulp-purgecss already seems to support the rejected option to output unused selectors
+1
+1
+1
+1 .. this sounds essential to be fully aware that the selectors removed are not needed.
I need it to be sure I have whitelisted needed classes and it would be good to have a reference to go back and remove my own unused css directly.
Most helpful comment
the option
rejected: trueonly tells purgecss to collect all the rejected selectors, its only available if you use the node API. The gulp plugin and the CLI don't yet have the feature to output the rejected selectors. We will try to get to it but if you feel like creating a PR, that would be very helpful.