6

I'm in the process of taking a couple of separate asp.net applications, and combining them.

One problem is rationalizing the CSS between the two app - app1 has two css files, while app2 has about 8 of them. Much of the CSS between the two apps is the same, but there are some differences. I'm looking for a tool to compare all the elements of each app, and show what's missing, what's different, etc. Ideally the output would be 3 files: Common, app1 and app2, but I won't be that fussy if it can just show me the differences between the two apps.

Does such a tool exist?

David Harkness
  • 35,992
  • 10
  • 112
  • 134
chris
  • 36,094
  • 53
  • 157
  • 237

4 Answers4

2

If you hate downloading tools, there's an online version of css comparer here http://www.alanhart.co.uk/tools/compare-css.php

It provides a comparison of css class files between two files

Whimsical
  • 5,985
  • 1
  • 31
  • 39
  • It shows no differences for one pair of fairly complex CSS files into which I introduced a difference, and it doesn't even work for a trivial pair of files. At least with the latter it shows "Class not found" which is probably an error message leaking into the output. – David Harkness Jul 23 '14 at 00:10
1

I don't know of a stand-alone tool tailored for this specific purpose. There's a PHP class called "CSS Comparer", but I have no idea how easy it is to use. The screenshot on that page looks promising though.

Personally, I would probably just concatenate all the files together, so that you have one file for each app, and then run a diff on them. To make it even easier, you could run both files through something like CSSTidy or do some imaginative file processing with search/replace and sorting. That could get all the declarations in the same order in both files, so the diff would be clearer.

Chad Birch
  • 73,098
  • 23
  • 151
  • 149
1

Combine all of these files into a single file and give it a run through a CSS optimizer or compressor. An optimizer should see all of your duplicate selectors and weed them out.

I'd recommend YUI's compressor, but there are plenty of web-based compressors/optimizers available, too. Here's one and another. YMMV with them, but a good Google search can turn up a bunch more.

ajm
  • 19,795
  • 3
  • 32
  • 37
-1

Normally I'd recommend diff. Since you explicitly write that you are looking for something "not diff based", maybe you could describe why diff does not help you.

Then others might be able to propose something different.

sleske
  • 81,358
  • 34
  • 189
  • 227
  • 3
    Diff won't work because it's file- and line-based. Say App1 has 50 CSS elements in 2 different files. App2 has 60 elements in 8 different files. I need to see how many of the 50 elements are the same, how many are different, and how many don't exist. – chris May 12 '09 at 16:41
  • This is what I have been looking for, for a long time now. I think I will end up writing it myself and selling it as an online automated service. :) – dimitarvp Aug 31 '12 at 21:21