I use this with tailwindcss as per the tailwind docs and I think my css is under 2kb despite using a big framework that generates tons of classes.
tailwindcss, without the purgecss or similar tool, will produce 80kb compressed css… very large.
In my experience.
So most tools chains (at least the ones I come across) use purgecss or similar to get rid of the css that was not used.
in other words, my html, Eleventy and PebbleTemplate (.peb) files, include the whole main.css (main file generated by by tailwindcss), and then in production builds, PostCSS uses purgecss plugin and it the unused styles.
I have generated sites, and don’t know what classes I’d end up using in many cases until the site has loaded.
If I could purge css based on the generated html, that would be so cool, but because that’s outside the scope of purgecss, I simply hand write my css to be nice and minimal without postprocessing.
Correct me if I’m wrong. It sounds like the cool goal is for the client to remove unneeded css after it loads the content, but doesn’t that ignore the key benefit of purging css (i.e. the server sends less bytes of css)?
I should say “until the site load request has been processed by the server” and the html server side generated.