Auditing Unused CSS on Complex Web Pages

I know that there are several tools for finding unused CSS in a static web page. But in most real-world scenarios that I come across, a lot of CSS is used after some or other interactions on the page, possibly with a new modal opening or tooltips, etc.

In such scenarios, what would you suggest? How to save a tab on my ever-growing render blocking block?

The only way I can do this is to run the usual tools like unused-css-detector in combination with Selenium - to check the known interactions and see what remains unused. But here the big assumption is that I need to know all the interactions on my page that could use the new CSS. Is there a way to achieve my goal without making this assumption?

In an ideal world, I could undo all the CSS used by the visitor’s browser on my page on my server. Then I collected data for the month, collected and got a fairly accurate idea of ​​the actual unused CSS.

Any good ideas?

+4
source share
1 answer

, , . , , CSS - " " , , . , ROI , .

, , , . , , , , .

JavaScript, , . " ", Pull Request , .

, .

https://www.bleachcss.com/

0

Source: https://habr.com/ru/post/1661885/


All Articles