7

We're bringing in outside content to our existing site along with its associated external CSS stylesheet and need to identify the CSS selectors that share the same name across the two files. Once identified, we plan on manually modifying each duplicate in the newly imported file, then changing the HTML accordingly.

Does anyone know of a tool that will do this? One painful way I thought about was to combine all the CSS into one Word Document and going down the page doing manual Finds? That would be nice to avoid though.

linnse
  • 415
  • 4
  • 21
  • possible duplicate: http://stackoverflow.com/questions/16762/are-there-any-tools-for-merging-css – Maksim Vi. Aug 31 '12 at 07:12
  • CSSBurner (http://www.cssburner.com) can do this. It locates redundant/repeat selectors and rules and all other types of CSS that can be removed or reduced. I was able to remove dozens of kB from my CSS files – The One and Only ChemistryBlob Sep 25 '17 at 13:41

2 Answers2

1

There is a firefox plugin called Dust me selectores which is designed to find unused CSS code. It may be what you're looking for.

Spudley
  • 166,037
  • 39
  • 233
  • 307
0

You could merge the files into one, use a tool like CodeBeautifier with sort selectors enabled. A word of caution though: sorting selectors may change how they are applied to the final document.

Lucas Green
  • 3,951
  • 22
  • 27