Tool for checking unused CSS styles and coverage?

I have a SharePoint farm with approximately 20 css files, and I am convinced that it can be condensed much less. However, passing through each page will undoubtedly be tiring and enraging.

So, is there a tool available to check which part of the css file is used on the website / website?

+4
source share
2 answers

The only thing I am familiar with is: http://unused-css.com/

A web crawler monitors links to your site. On each page, we extract the CSS files and list the selectors. Selectors are tested on the html page. If the selector matches an element, it is marked as used. When all files have been visited, a new css file is created using only the selectors used. This is a file that you can download.

I have not used it extensively, though.

September 6, 2012 Update: Another Promising Tool - Deadweight

Deadweight is a CSS coverage tool. Given a set of style sheets and a set of URLs, it determines which selectors are actually used and reports that can be "safely" deleted.

January 29, 2013 Update: Another new tool - http://www.csstrashman.com/

Trashman checks your site in real time for the DOM and draws a new, more elegant definition to engineers that captures styles down to the pixel.

+7
source

I just found a set of tools that can help you and the link below is

10 CSS Validation Tools or if used

I have never used any of these tools, but I would recommend "Dust-Me Selectors" by reading its description.

+4
source

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


All Articles