The way I structure my CSS is very much like you said - taking the Software Development principles of Object-Oriented programming, and is pretty much inline with what everyone else has said.
I generally break my CSS up to the following categories: - reset.css : Reset all browser defaults. Gecko, WebKit and Explorer based browsers all have different presets (lists are just one example) so this is very cruicial in making the look and feel consistent. - skeleton.css : Defines my main architectual skeleton, i.e. will it be a three-column layout? a fluid layout? a fixed width layout? This essentially allows me to reuse the CSS very efficiently. I can also switch between layouts very quickly. After that I generally make a judge call on how complex the organisation is and how the CSS might or will be overriden. In a large and complex organisation, that generally consists of smaller individual business I generally split the CSS up even further into the following categories: - content.css - typogaphy.css - forms.css - tables.css I might even go further by splitting the positioning away from the colour. It really depends on how confident the people within each different business are with CSS. This generally allows many people; with varying degree of confidence and skill level to make small changes which might be necessary for their particular business/branch. In regards to "I'm guessing this sort of structuring comes at a cost because a number of requests need to be made to the server." this is generally untrue. In principle this is exactly how download accelerators work. They split a large file into smaller segments and sent multiple requests. Since the browser environment is completely multi-threaded it should actually boost performance. (Note: I am not 100% certain if this is the fact, but there is no evidence to suggest otherwise either). In the end you should also generally use a bridge file to connect all the CSS together. Hope that answers your question. On Tue, Jun 10, 2008 at 9:00 AM, James Jeffery < [EMAIL PROTECTED]> wrote: > Lets have it. How are you guys structuring your CSS files? > > I have been having a think about this over the last few days. My research > attempts have failed because most the articles i came across were outdated - > so i tend not to trust them. > > One method i thought about (not sure if it's been coined) is one based on > Software Engineering principles, obeying rules such as decoupling et cetera. > Maybe by using these principles modules can be included by importing the > needed CSS file (and path) in the root CSS file. > As i am writing this i am certain CMS systems use this method of > structuring CSS. > > I am sick to death of having to over comment my CSS files to find what it > is i'm looking for. I would much rather break up my layout into semantic > chunks and create a seperate CSS file for each chunk (i.e navigation, > content, footer). > > I'm guessing this sort of structuring comes at a cost because a number of > requests need to be made to the server. > > Regards > > James Jeffery > > ******************************************************************* > List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm > Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm > Help: [EMAIL PROTECTED] > ******************************************************************* -- - Anton Babushkin ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************
