Is there a way to automate a CSS audit for file-level info without rendering the page? Could Selenium be used for this purpose?
I've come across browser plugins that can help audit CSS files, but manually reviewing results for each page would be time-consuming.
Motivation
Our web app has accumulated various CSS files in its template header over time, causing conflicts between different rules. To streamline our styling process, I plan to relocate older references from the site template to individual page headers.
To understand which CSS stylesheets are being utilized where on the site, my current idea is to crawl the entire website and track their usage.
UPDATE
Considering the potential for unintentional rule matches, I'm beginning to think that scripting this process may not be feasible. It might be necessary to review each page individually, as some pages could rely on conflicting styles.
Furthermore, I have doubts about the accuracy of static CSS checkers, especially when dealing with template files. Certain rules may only apply at runtime due to server-side elements or JavaScript manipulation.