Having just finished creating a theme for Drupal 5 I just wanted to mention that it was a nightmare to skin because of the number of CSS files. Its a shame because it has huge potential and this change would make life difficult for the beginners and newbies who want to create/modify new themes for Drupal 5.

Ok, let me get to the point:

1) What was the reason for splitting 1 main CSS file into a plethora of mess?
2) While it's not impossible to work with 10+ CSS files at once, it becomes a little confusing and also creates further work for us theme designers when installing new modules as we must edit any CSS file thats "shipped" with the module.
3) I may know what your answer for question1 is, but I'd like to state that those "system" and "user" css files are being loaded to guest users and on first page load. Doesnt that defeat the whole point of breaking down the CSS into files?

I hope this is just a bug in the beta and I trust something will be done to fix this.

Heres the suggested fix:
- Hide "system" CSS files from guests & authenticated users (only admins need to have this css file preloaded).
- Hide "user" CSS files from guest users (only authenticated users need to have this css file preloaded).

------------------------------
BioALIEN
Buy/Sell/Trade with other webmasters: WebMasterTrader.com

Comments

webchick’s picture

Priority: Critical » Minor

Heres the suggested fix:
- Hide "system" CSS files from guests & authenticated users (only admins need to have this css file preloaded).
- Hide "user" CSS files from guest users (only authenticated users need to have this css file preloaded).

Er, no. system.module _is_ Drupal. The styles defined there are general styles that apply to every page. tables, list items, etc. It makes perfect sense for this to be loaded on each page. system.module is essentially the old drupal.css with all the module-specific stuff broken out into other css files. This is because if you're not using aggregator module, for example, you shouldn't need to load styles for it on every page.

user.css could be loaded conditionally though, because its styles only affect user administration sections. But this is hardly critical.

BioALIEN’s picture

Thanks for the reply. Well, I have the aggregator module turned off.

Another addition to this issue report is if the site is in maintenance, the page is literally showing just the body and a H1 tag with a message. Hardly any need to output 10+ stylesheets there for a visitor? Only the maintenance.css stylesheet would be needed in this instance.

<style type="text/css" media="all">@import "/drupal5/modules/system/defaults.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/block/block.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/menu/menu.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/poll/poll.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/search/search.css";</style>
<style type="text/css" media="all">@import "/drupal5/modules/watchdog/watchdog.css";</style>
<style type="text/css" media="all">@import "/drupal5/themes/bluemarine/style.css";</style>

I hope you agree with me regarding this point?

Crell’s picture

The idea of breaking drupal.css up was to make it easier to theme, because you can remove a specific module's provided CSS without removing all of Drupal's CSS. You do that in your template.php file. (I don't recall the mechanics at the moment, but I believe it's in the module upgrade guide or the theme upgrade guide.) Then you can either copy it into your theme's style.css and edited as needed or just leave it out, depending on what you're doing. You should never edit a module's provided CSS directly, as that makes for a maintenance mess.

There's a patch in the works to cache the entire set of CSS files into a single file for performance. Based on the benchmarks in that thread I'd say the performance benefit and simplicity of caching everything into one compressed file once is better than selectively sending files sometimes, especially since it's then browser-cached.

For site maintenance, it shouldn't be used that often so I don't think it would be a big performance issue. I can see an argument for just pushing maintenance.css in that circumstance, though I'm not sure what the complexity cost would be. You probably want to note that in the thread I linked above if you think it is a serious concern.

Tempted to call this a dupe of the issue mentioned above... (And can someone with admin access please fix the broken link tag in the first comment? Thanks.)

BioALIEN’s picture

Crell, thank you for the post. I was thinking the same thing with regards to splitting the css files. However, when I discovered that things like user.css and other admin related css are being displayed to anonymous users it kind of made me question the reason for splitting up the files.

With regards to the maintenance page, it's completely wrecking my theme because it's outputting all 10+ stylesheets as well as the maintenance.css file. In my opinion:
1) the maintenance (front) page should have nothing but maintenance.css
2) maybe site.com/user/login can have all the relevant css stylesheets there

I'll go and contribute to the thread you've posted :)

webchick’s picture

Status: Active » Closed (won't fix)

bioALIEN: Again. Don't confuse the name of the module with some sort of admin/user status. Look at the contents of the CSS files. If system.css only got included on administration pages, your entire site would look like crap. There are styles here used on _every_ page. Similarly, user.css shouldn't be included for all authenticated users, but rather only on the access control panel and a few others, since the styles there are only for user admin panels.

I'm going to mark this as "Won't fix" as CSS caching is covered by the link Crell mentioned, and the crux of your complaint (that system and user should only be output to admins and logged-in users respectively) is not valid. If you want to open separate issues about only outputting maintenance.css on site maintenance pages, and user.css on user admin pages, then go for it. But please report only one bug per issue; lumping all kinds of stuff under one issue though makes it really hard to sort through to find what the problems are and to fix them.

BioALIEN’s picture

Title: Too Many CSS Files + Not Being Linked To Roles System » Too Many CSS Files
Status: Closed (won't fix) » Fixed

This issue is now obsolete/fixed thanks to the preprocessor and css includes patches that went into Drupal 5 HEAD.

Thanks to all involved :)

Anonymous’s picture

Status: Fixed » Closed (fixed)