Error message

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 697 of /home/adaptive/public_html/includes/bootstrap.inc).

Load Unlimited Stylesheets in IE7

What a bane of the theme developers life, [IE's inability to load more than 30 linked stylesheets](http://support.microsoft.com/kb/262161). This is a huge pita and forces you to either turn off modules or manually aggregate your themes stylesheets, such as how the [Genesis theme](http://drupal.org/project/genesis) does with its option to use an "all-in-one.css" stylesheet as a workaround.

Those days may be behind us thanks to the newly released [IE Unlimited CSS Loader](http://drupal.org/project/unlimited_css) module. Put simply, this module turns stylesheet links into @import. [Some may argue](http://drupal.org/node/228818#comment-1475138) this has [performance implications](http://www.stevesouders.com/blog/2009/04/09/dont-use-import/), moreover, still others have [pointed out](http://drupal.org/node/228818#comment-1477564) that the modules approach may not play well with YAML or other themes that modify the CSS array.

>I can see this module coming in handy during theme development.

These things said, I can see this module coming in handy during theme development. Once your done with development, switch the module off, aggregate and compress CSS and happy days.

If you can't turn on CSS aggregation because you are using private download method, this module will provide a pretty good bridge until a real solution is implemented for Drupal core.

## PHPtemplate\_preprocess\_page(&$please)
And what you say, you don't want to use *yet another module?* No problem, [the developer](http://drupal.org/user/186696) [shows how this can be done](http://drupal.org/node/228818#comment-1473586) using phptemplate\_preprocess\_page:

<?php
function phptemplate_preprocess_page(&$vars) {
 
/**
   * Slove 30 CSS files limit in Internet Explorer
   */
 
$preprocess_css = variable_get('preprocess_css', 0);
  if (!
$preprocess_css) {
   
$styles = '';
    foreach (
$vars['css'] as $media => $types) {
     
$import = '';
     
$counter = 0;
      foreach (
$types as $files) {
        foreach (
$files as $css => $preprocess) {
         
$import .= '@import "'. base_path() . $css .'";'."\n";
         
$counter++;
          if (
$counter == 15) {
           
$styles .= "\n".'<style type="text/css" media="'. $media .'">'."\n". $import .'</style>';
           
$import = '';
           
$counter = 0;
          }
        }
      }
      if (
$import) {
       
$styles .= "\n".'<style type="text/css" media="'. $media .'">'."\n". $import .'</style>';
      }
    }
    if (
$styles) {
     
$vars['styles'] = $styles;
    }
  }
}
?>

Last updated 15th April, 2009 - 7:48pm

Authored by Jeff Burnz on