CSS Compare is a utility to compare two CSS files and output unique styles. It's useful for exporting customizations and managing stylesheet versions.
Unlike traditional text comparison tools, CSS Compare evaluates individual CSS styles instead of pure text blocks, allowing for net comparisons regardless of where a style may appear in the file. CSS Compare is compatible with all levels of CSS.
This project originated when I was working with a highly customized SharePoint 2007 farm. Its CSS files had been directly modified all over the place. Since SharePoint 2010 had new CSS files, I had to extract all styles that were tailored for that site.
This utility allowed me to easily export all of the customizations to one file and drop it into SharePoint 2010, which worked perfectly. I've since found a host of other uses for it.
Since it does style-by-style CSS comparisons instead of block-level text comparisons like other tools, it works better than pure text comparison tools.
Version 2.1 Now Available:
- Preserved initial ordering of styles
- Added support for @Media selectors
- Added automatic comment removal
CSSCompare.exe accepts two parameters:
- -v1: The file whose unique values you wish to extract
- -v2: The file to compare against
Only additive styles from v1 will be exported.
To save the output of this tool, use the redirection operator (">") followed by the file name.
CSSCompare.exe -v1 C:\customized.css -v2 C:\original.css > C:\difference.css
For other projects by this author, visit http://bertjohnson.net