tags:

views:

32

answers:

2

I have about 40 'themes' that have each been copied and pasted from a 'default' theme and been modified uniquely. As time has gone on each of these themes has taken a shape of its own, some more, some less.

I need to be able to do an @import url(default.css); so that when I make changes to the default I do not need to cascade it down to all the themes.

Each theme and the default is about 2000 lines. I have tried to use a css optimizer but I couldn't get it to work. (Perhaps I'm doing something wrong?) Right now I'm just using diff to do all the changes line by line and it painstaking and will take me weeks upon weeks.

How do I do this quickly? There has got to be a way.

A: 

maybe you need to go about this problem with with something like this: seperate the css files.

create a base file.

that way things that are general to all themes will be at the base. and stuff that are indevidual will have to be put inside each of the 40 files avcorse.

guy schaller
The base file *is* default.css.
Maletor
A: 

Maybe a de-optimizer would do some good, but I don't know of any. It would allow to have one and only one instruction per rule, like:

selector1,selector2 {
  instruction1;
  instruction2;
}

becoming

selector1 { instruction1; }
selector2 { instruction1; }
selector1 { instruction2; }
selector2 { instruction2; }

That would allow you to use diff way faster and finally to combine these with an optimizer ...

Other than that:

  • I'd try PSPad (shareware, not free for commercial use) to get one-line CSS rules (menu HTML, format CSS inline). This will sort of associate instructions to their rule selector(s) when you use diff.
  • Then use softwares like Diffuse to compare a set of files (GPL) or DiffMerge (free for 30 days) or KDiff3 (GPL) to compare files 3 per 3
  • and get a default stylesheet and 40 shorter stylesheets

But you'll still have to check each template after having modified your default one: you can't know for sure, now or later, how each template overrid or not instructions from default stylesheet.

Felipe Alsacreations