Aug 182006

I decided last night that instead of trying to go through all the CSS files that comprise a Firefox theme by hand, or using utilities like diff that don’t handle cases where the contents of files are rearranged very well, I’d write a new tool designed specifically to compare the styles in two CSS themes.

I finished the utility a little while ago, and it’s working very well. I pass it two CSS files and it spits out a list of all the styles that are unique to each file, as well as a list of the styles that are common to both but have different definitions.

This is going to make the Theme changes in Firefox 2 document much easier to write. Still tedious, but not the massive task it would have been without this utility. I love handy-dandy utilities.

 Posted by at 5:18 PM

  6 Responses to “Better living through code”

  1. Nice stuff, eric. Also, I’m liking this wordpress theme. :)

  2. Thanks.

    Now I’m trying to think of ways to make this work even easier. Maybe turn the code into a GUI utility that displays the two CSS files’ styles side by side with the styles sorted into alphabetical order and disclosure triangles that let you compare the contents of styles visually to see what’s different exactly. Maybe later. What I have now is good enough for now. :)

    I sure like coding in Objective-C.

  3. Nice idea. Do you think you will publish it? Normally, I am using WinMerge for comparing, but as you said before it’s not that useful in CSS-files.

  4. I plan to release it in some form, yeah. It’s a Mac program though, written in Objective-C and using Apple frameworks for various tasks (data structures in particular).

  5. Shouldn’t you be writing these tools using XUL technologies? :P

  6. I figured I’d write the tool using the method that would get the job done the fastest, and Objective-C is awesome for stuff like this. :)