-Zen 5.x-1.x-dev
+Zen 5.x-0.8
+ * #196223: IE5 always loads @import print stylesheet
* #184232: Add README documentation
* #121991: Source rendering order needs adjustment
* #110897: oversize content causes IE6 layout breakage
drupal_add_css($vars['directory'] .'/html-elements.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/tabs.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/zen.css', 'theme', 'all');
- drupal_add_css($vars['directory'] .'/print.css', 'theme', 'print');
$vars['css'] = drupal_add_css();
$vars['styles'] = drupal_get_css();
+ // Avoid IE5 bug that always loads @import print stylesheets
+ $vars['head'] = zen_add_print_css($vars['directory'] .'/print.css');
}
// Send a new variable, $logged_in, to page.tpl.php to tell us if the
}
return strtolower(preg_replace('/[^a-zA-Z0-9-]+/', '-', $string));
}
+
+/**
+ * Adds a print stylesheet to the page's $head variable.
+ *
+ * This is a work-around for a serious bug in IE5 in which it loads print
+ * stylesheets for screen display when using an @import method, Drupal's default
+ * method when using drupal_add_css().
+ *
+ * @param string $url
+ * The URL of the print stylesheet
+ * @return
+ * All the rendered links for the $head variable
+ */
+function zen_add_print_css($url) {
+ global $base_path;
+ return drupal_set_html_head(
+ '<link'.
+ drupal_attributes(
+ array(
+ 'rel' => 'stylesheet',
+ 'href' => $base_path . $url,
+ 'type' => 'text/css',
+ 'media' => 'print',
+ )
+ ) ." />\n"
+ );
+}
drupal_add_css($vars['directory'] .'/tabs.css', 'theme', 'all');
// Then add styles for this sub-theme.
drupal_add_css($vars['subtheme_directory'] .'/layout.css', 'theme', 'all');
- drupal_add_css($vars['subtheme_directory'] .'/print.css', 'theme', 'print');
- drupal_add_css($vars['subtheme_directory'] .'/zen-classic.css', 'theme', 'all');
drupal_add_css($vars['subtheme_directory'] .'/icons.css', 'theme', 'all');
+ drupal_add_css($vars['subtheme_directory'] .'/zen-classic.css', 'theme', 'all');
// Optionally add the fixed width CSS file.
if (theme_get_setting('zen_classic_fixed')) {
drupal_add_css($vars['subtheme_directory'] .'/zen-fixed.css', 'theme', 'all');
}
$vars['css'] = drupal_add_css();
$vars['styles'] = drupal_get_css();
+ // Avoid IE5 bug that always loads @import print stylesheets
+ $vars['head'] = zen_add_print_css($vars['subtheme_directory'] .'/print.css');
}
return $vars;
}