Hi,

I'm trying to make some changes to print.css but noticed that they weren't being applied. I realized that print.css is listed first instead of last in the source code:

<link rel="stylesheet" href="/sites/all/themes/zen/zen_classic/print.css" type="text/css" media="print" />
<link rel="shortcut icon" href="/sites/default/files/zen_classic_favicon.ico" type="image/x-icon" />
<style type="text/css" media="all">@import "/modules/book/book.css";</style>
<style type="text/css" media="all">@import "/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/modules/system/defaults.css";</style>
<style type="text/css" media="all">@import "/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/style.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/tabs.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/html-elements.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/layout-garland.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/icons.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/zen-classic.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/zen_classic/zen-fixed.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/zen/block-editing.css";</style>

zen classic's template.php has the following code:

drupal_add_css(path_to_theme() .'/tabs.css', 'theme', 'all');

// Then add styles for this sub-theme.
drupal_add_css(path_to_subtheme() .'/html-elements.css', 'theme', 'all');
drupal_add_css(path_to_subtheme() .'/layout-garland.css', 'theme', 'all');
drupal_add_css(path_to_subtheme() .'/icons.css', 'theme', 'all');
drupal_add_css(path_to_subtheme() .'/zen-classic.css', 'theme', 'all');
// Optionally add the fixed width CSS file.
if (theme_get_setting('zen_classic_fixed')) {
  drupal_add_css(path_to_subtheme() .'/zen-fixed.css', 'theme', 'all');
}

// Avoid IE5 bug that always loads @import print stylesheets
zen_add_print_css(path_to_subtheme() .'/print.css');

Is anybody having the same issue or have any suggestions/solutions? Is it a bug?

Thanks.

Comments

new_B’s picture

Alternatively, I tried changing all of the 'all's to 'screen's so that print.css would be the only one used when printing. Does anybody know if there are issues with this (besides the loss of styles that we want to keep from the other stylesheets)?

johnalbin’s picture

Status: Active » Fixed

Because of a bug in IE5, we have to include the print.css using a <link /> tag.

It’s awkward, but just give those CSS rules more specificity than the ones in the other stylesheets.

The order is already correct in Zen 6.x

new_B’s picture

Thanks for the info John.

As an alternative solution, I had removed zen_add_print_css(path_to_subtheme() .'/print.css'); from zen classic's template.php and added <link rel="stylesheet" href="<?php print $base_path . $subtheme_directory ?>/print.css" type="text/css" media="print"> to zen classic's page.tpl.php right after the code to include ie.css.

Is this OK too?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.