Extract used CSS from page

I need to extract used CSS from a 19000-line CSS file, where 98.4% of it is not used (ouch). I know that you can use the Chrome developer tools to view CSS coverage, for example:

enter image description here

But this does not even allow you to jump on the green lines. Manual movement along the 19K lines is simply not possible.

Chrome Lighthouse doesn't seem to give you the ability to see only the rules you need, such as developer tools.

I tried using Firefox "CSS Usage" (which many sites recommend), but it requires FireBug, which in itself is not compatible with the current version of FireFox.

Can anyone think of a way to pull only CSS that was somehow used?

+4

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


All Articles