I would like to get opinions on having a lot of small stylesheets (breaking up your styles into groups) versus having just a few large ones. In the end, compression takes care of having multiple files, but why do you like one over the other. I am not a fan of having 20 css files open at one time. I work faster when having just a few sheets.
... In the end, compression takes care of having multiple files ...
What does that even mean?
gzipping your css
gzipping/aggregating/compressing your css files
gzipping/aggregating/compressing your css files
How does any of that reduce server requests? Does aggregation create one from many and if so, what do you use to accomplish this?
My answer is still "one". I see no advantage to separate files.
There are many ways. Most
There are many ways. Most notably, through php, apache mod_deflate and a few others. Most large sites do regardless of how many css files they have. I could/would never just use one file. I work with usually 3 to 4.
This site does it. (Drupal of course)
Aggregating combines css
Aggregating combines css files for the same media types etc. into one file. Drupal's inbuilt css aggregation does this.
Having multiple files is not really a problem in most normal low traffic sites.
Many large site have different themed sections, so it makes sense to have separate stylesheets for the section. You could have core stylesheets used site wide then add specific ones where required.
Stylesheets should be cached by browsers, so on subsequent visits the http requests would be minimal.
IE6 not sure about other versions only supports 30 css files, any more then that are ignored.
@Tony I am looking for more
@Tony I am looking for more of opinions instead of a standard answer. For instance Zen, which has:
block-editing.css block-editing-rtl.css blocks.css comments.css drupal6-reference.css fields.css forms.css forms-rtl.css html-reset.css html-reset-rtl.css ie.css ie6.css ie6-rtl.css layout-fixed.css layout-fixed-rtl.css layout-liquid.css layout-liquid-rtl.css messages.css messages-rtl.css navigation.css nodes.css page-backgrounds.css pages.css pages-rtl.css panels-styles.css print.css tabs.css tabs-rtl.css views-styles.css wireframes.css
When I am theming a site, I hate having all of these open (or opening and closing as needed). I get confused and forget what tab is sitting where. It just makes me mad. I wanted to know others opinions on it.
Ok since you are talking
Ok since you are talking Drupal themes, I usually build my own from scratch with only a couple of files.
Yes that is too many stylesheets to be managing in one theme.
With Zen aren't you meant to use it as a base them and create your own sub theme that just over writes what you want.
If you are having to modify all of those files then you would be better of starting from scratch or using a different base theme.
One problem with Drupal is that every module can have it's own stylesheet. This can be good but in many cases it means the site is over styled. Core overrides default browser styles, modules override core, then themes override module styles. It provides a lot of flexibility but you end up with thousands of lines of CSS.
In Drupal 7 it is easy enough to turn off stylesheets in your theme http://drupal.org/node/263967
All those are in zen starter,
All those are in zen starter, which is when your creating a custom sub theme.
What I am more looking for is what people like better using ----A few master monolithic css files, or having them broken up into files of a certain grouping, like a navigation file, a comments file, a nodes file, a pages file, a messages file, a forms file, etc. I have been working with Drupal for 4 years, so I am familiar with everything regarding Drupal. I am just interested in what people feel more comfortable with and why.
I hate having so many css files, but I am sorta being pushed to like it.
Just one file
With both screen and print styles in it.
iamfratty wrote:... I
... I could/would never just use one file. ...
That's fine but I would like to know the advantage. So far I've found exactly zero.
Just one file ... With both screen and print styles in it.
Makes the most sense to me.
Sadly this question gets
Sadly this question gets slightly pre-empted by the monster CMS platforms that have all but taken over the site development world; WP as an example has to work to multiple stylesheets, chiefly due to modules or plugins requiring to add their own styles but also most theme authors tend to break their own theme into two or three style sheets.
Personally I would still contend that working with a single well structured file is the correct approach. @importing other styles - by way of typifying one reason there might be multiple sheets - was always the method for adding further styles if you were say loading the master files for the site then as a sub dept you required particular styles, so the page loaded a master style file @importing a common set and then described the unique styles for those sub pages.
I find I've been drawn slightly to the idea of breaking styles up somewhat, into say a sheet for the layout framework, the main site wide styles, and perhaps a sheet for pages that required markedly different styles. I do not think though that this approach has any real benefit over the single stylesheet but does mean you are not always scrolling through hundreds of lines when editing.
One disadvantage of multiple files can be that it becomes harder for others to maintain and in effect the supposed benefit of smaller groups is actually lost in a confusion of flow of styles, of the danger in repeating rules/ properties unnecessarily.
The example you provided earlier of the Zen sheets is horrendous but seems typical of framework / CMS approaches and is something I would find extremely irksome having to work with.
I think the only benefit for
I think the only benefit for having sheets set up like the Zen theme is for non-techie usability. Having it that way means more people will use your theme because it is easier to use. Like having so many point-click options in the admin (which I hate). It might be easier to point and click for non-techies, but it creates unnecessary and more code. As a person that knows what they are doing, I just want the bare bones basics, and I will add what I need to.