Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to audit website for missing CSS declarations [closed]

Tags:

html

css

I've recently (manually) removed a ton of unused CSS from a website, but it looks like I went a little over aggressive.

What is a good way to audit the html and javascript to determine which style definitions are missing from the CSS?

To clarify for @Paulie_D and others, I am looking for a way to find classes in the HTML and Javascript that ARE NOT in the CSS files.

like image 700
Parris Varney Avatar asked Nov 01 '22 07:11

Parris Varney


1 Answers

In terms of debugging I use the _debug.scss file from Inuit.css to check for HTML oddities I may have missed.

https://github.com/csswizardry/inuit.css/blob/master/generic/_debug.scss

Includes things like finding empty elements, or <a> tags with # as the href.

:empty{
    outline:5px solid yellow;
}

It's probably a bit basic but based on the information you provided this might be your best solution, at least to start with.

like image 150
geebru Avatar answered Nov 09 '22 09:11

geebru