Closed (fixed)
Project:
Zen
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2007 at 01:50 UTC
Updated:
11 Feb 2007 at 19:45 UTC
m3avrck and I discussed the use of @import in css files and why they shouldn't be used with Drupal 5.
1) Right now we're only using @import for all styles, where one of it's really big advantages is including different screen/print versions of the same files.
2) A seperate HTTP request is made for every CSS file. Meaning that just to load the CSS in Zen, it requires 3 or more requests.
3) Most importantly, the CSS preprocessor in Drupal 5 doesn't support compressing files through @import
A couple of options to get around this:
1) Put all the css files together
2) Use drupal_add_css() to add the icons.css and layout.css in template.php in the _phptemplate_variables()
Comments
Comment #1
moshe weitzman commented2) is what I do in bluebeach theme for groups.drupal.org. actually, i had to do the drupal_add_css in the global scope (i.e. not inside a function) in order for the css file to show in all cases.
Comment #2
jjeff commentedAhhh... Interesting point...
We hit a bit of a problem with the subthemes though. For example, the Zen-Fixed theme basically only consists of 2 or three lines of code and then several @import declarations to include files from the parent directory.
This is a good example of where subthemes should actually cascade the template.php, page.tpl.php, node.tpl.php, etc...
I'm going to need to do a bit of thinking about this one to come up with an elegant solution.
Comment #3
quicksketchI use this approach:
Comment #4
jjeff commentedCommitted major change that fixes this problem, but addresses subtheme issues too... also adds the ability for subthemes to define their own node.tpl.php, block.tpl.php, etc...
Comment #5
jjeff commentedComment #6
(not verified) commented