Skip to content
Snippets Groups Projects
Commit a3e25d2e authored by John Albin Wilkins's avatar John Albin Wilkins
Browse files

#196223: IE5 always loads @import print stylesheet

parent b2a804ac
Branches 1.0.x
Tags 1.0.0-alpha5
No related merge requests found
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
......
......@@ -176,9 +176,10 @@ function _phptemplate_variables($hook, $vars = array()) {
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
......@@ -328,3 +329,30 @@ function zen_id_safe($string) {
}
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"
);
}
......@@ -72,15 +72,16 @@ function zen_variables($hook, $vars) {
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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment