1

CSS-libraries like Bootstrap and jQuery UI are used in my current project. It's obvious that most of the rules from these libraries aren't used, so I was wondering is there a way, using some tool, to remove unused rules from the final CSS bundle when I'm making a release build using Visual Studio?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Gelo
  • 67
  • 1
  • 10

1 Answers1

1

This article here on KeyCDN seems to have a lot of great options

I'll quickly mention here from that article that you can see for yourself in Chrome Dev Tools which rules are not being applied:

  1. Open Chrome Dev Tools, and go to the Sources tab
  2. Open the command menu
  3. Type in “Coverage” and click on the “Show Coverage” option
  4. Select a CSS file from the Coverage tab which will open the file up in the Sources tab

Any CSS that is next to a solid green line means that the code was executed. Solid red means it did not execute. A line of code that is both red and green, means that only some code on that line executed.

Andrew Shearer
  • 268
  • 4
  • 17
  • Should the removing of red lines be done manually? Or is there a way to automatically do it in Developer Tools? – Basj Feb 04 '22 at 00:58