Get the Percentage of Unused CSS on a Page with Google's Puppeteer

Tyler Clark
InstructorTyler Clark

Share this video with your friends

Send Tweet

In this lesson we are going to send commands to the chromium browser with Puppeteer. These commands will enable us to calculate both the total number of CSS stylesheets used on the page and the ruleUsage for each of those stylesheets. With these metrics we will be able to calculate the percentage of unused CSS on the page.