SplitCSS.com
p/splitcss-com
API for reducing unused CSS on web pages
vlad86

SplitCSS.com — API for reducing unused CSS on web pages

2
Web pages contain too unused CSS.
SplitCSS is an API that fully executes the web page (unlike CLI tools) and returns only the CSS that the web page is using.
SplitCSS will save you bandwidth and optimize website speed with a single API call.
Replies
Best
vlad86
Maker
I came up with this idea while trying to implement a code splitting technique on a website in order to reduce the amount of dead CSS rules per page. Chrome does a great job showing you the unused CSS selectors in the stylesheet, but it's not so easy to do this dynamically for different pages. For those of you who are wondering: - The API calls are cached. They will not be a problem with performance. - if an error happens, the service returns the original stylesheet - so the visitor will not see an unstyled website. - if a certain class is included only after an user-action, it should be marked as such within the stylesheet and it will always be there. - the difference with the CLI tools that do a similar task is that it's using Headless Chrome to fully execute the web page before searching for unused CSS selectors. The CLI tools usually perform a scan in your project files only. - it's not a silver bullet for all possible web apps. But there are many cases where it would be big savings in CSS filesize. If anyone has questions, feel free to contact me. If you find it interesting, you can request early access on the website.
Gil
The product is simple but provides absolutely necessary functionality for a snappy page load. Even though existing CLI tools could do the same thing for you, nothing beats convenience and ease of use.