How to list all the CSS classes that I have used throughout my code, which DO NOT HAVE "CSS ruleset" defined for it?
Something like
/*Definition (or Rule set) for .some-random-class
doesn't exist or is commented out like below
.some-random-class {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
*/
.known-class {
background-color: red;
width: 100px;
height: 100px;
}
<div class="some-random-class">
<span class="known-class"/>
</div>
I'm expecting something like getAllUndeclaredCSS()
to return ['some-random-class']
as the answer.
Update 1: This is not same as "Checking which CSS Styles are being used", since the definitions doesn't exist, but the usage exists
Update 2: I have initial answer to help me get started. Doesn't work in all cases, but works to some extent.