July 31, 20179 yr It's not very reliable at present, especially for SPAs or anything where classNames might be generated based on conditions.
July 31, 20179 yr Author Not usable then - even for very simple CSS? Any alternatives you would recommend?
July 31, 20179 yr Write clean CSS. Don't use a bloated framework like Bootstrap. use a pre-processor like Sass where you can feature toggle things.
July 31, 20179 yr Chrome developer tools will also tell you about any unused CSS and JS in your code. The problem I've found with both, is that it's extremely difficult to view across an entire site or application, especially if the app requires authentication. Even if it's possible to provide a sitemap, it's insanely slow to process. With purifycss, I've unknowably removed important CSS before that wasn't on the public-facing site, and that's down to the tool not giving me the full picture of what's going on. I agree with Rob, stick to writing CSS as clean as you can, don't go nuts on filesize, don't use a framework like Bootstrap, and you should be good to go. Something like decent image compression, and enabling GZIP on your server, will have a bigger overall benefit than taking off 10kb of CSS.
August 1, 20179 yr will have a bigger overall benefit than taking off 10kb of CSS. Definitely this. I see so many people prematurely optimising things rather than targeting the actual bottlenecks.
August 2, 20179 yr Author It's less about speed improvements - my CSS is not complex enough to warrant that - rather it's about my trial and error design process leaving lots of styles I ended up not needing together with a desire for tidiness. In other words, having built a CSS through trial and error I want to clear out all the stuff i decided not to use so I can review any bits I've magpied from stack overflow or similar to understand them and rebuild more tidily for future projects.
August 2, 20179 yr You'll just have to be diligent about removing stuff and keeping things clean. Using something like Sass makes this much easier as you can use modules then.
Create an account or sign in to comment