pucelle / vscode-css-navigation

Allowing Go to definition from HTML to CSS, or Find References from CSS to HTML.
https://marketplace.visualstudio.com/items?itemName=pucelle.vscode-css-navigation
MIT License
67 stars 7 forks source link

[Feature Request] Identify Unused CSS Classes Across HTML, PHP, and JavaScript #87

Open KrisKomjati opened 1 year ago

KrisKomjati commented 1 year ago

Would it be possible to extend the functionality to also list CSS classes that are not being used or referenced in the HTML, PHP, or JavaScript files? Currently, the extension shows where each CSS class from the stylesheet is used, but it would be helpful to see which classes are not utilized in these files as well in a click of a button. No modifications action is required from the button press, only an indication, so that we can investigate those "unused" css declarations.

Or if there is already a visual studio extension solution for that, can you reference one?

pucelle commented 1 year ago

As I know, there is no plugin to do so recently. Making the plugin to detect all the unused CSS codes is possible, but may be hard and not accurate enough.

But one tool of Chrome devtools can do so, at here: image