Bill Moseley wrote:
> I just looking for a few tips on how to organize CSS files.
> 
> First, I'm ending up with quite a few css files for
> all the parts that might get replaced.  Is it reasonable to separate
> the css into small files like that?
> 
> Second, I can see where there could be a lot of duplication in the css
> files.  With my example above, "green's" style.css is basically a copy
> of the default style.css, with a few changes.  Is it more common to
> instead have one css file used by all sties and then just override
> specific css for the branded sites?

Of course there's no one-right-way to do this, but here's what I would 
suggest. Have one master CSS file, say style.css, that every page 
references. Inside the style.css, put everything that is common across 
all brandings. You may even want to put the default branding in this 
file. Then, at the end of the file, put:

@include "green.css";

In green.css, you put everything that brands the site "green", possibly 
overriding/changing some of the styles you've defined in style.css. 
Then, to change the look of the whole site, you just need to change the 
1-line in style.css.

You could also call it "branding.css", then just swap the file in order 
to change the branding. (I'm not really sure how often you'll be 
changing the branding, but it sounds like just once per server).

You could split up the CSS file then into smaller files, and reference 
those with @includes, but personally, I'd rather just use comments in 
style.css to organize it.

It's totally up to you, but I'd just try to 1) not duplicate anything 
unnecessarily, and 2) try to make it as easy to maintain as possible.

Cheers,

Jesse Skinner
www.thefutureoftheweb.com
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to