Right now (1.2 version), unlimited_css will use @import instead of <link> if the number of stylesheets is bigger than 22.
Someone (=mikeytown) suggested to make this number configurable via an admin form (see #652690-9: Only process CSS if the browser is IE).

I think it is worth to discuss this, before we move on.

Comments

donquixote’s picture

donquixote’s picture

One idea I had about the magic number:
I think an admin form is probably not the best idea to set this number.
It could make more sense to set the number directly in page.tpl.php - this is the place where we know best how many hardcoded stylesheets we use. Unless it's a 3rd party theme.

This is how I imagine this to work:
- Instead of a html string, we set $vars['styles'] to be an object with a __toString() method and a render($magic_number) method or a setMagicNumber($magic_nunber) method.
- In page.tpl.php, you can then write print is_object($styles) ? $styles->render(25) : $styles;.

Alternatively, you can do in themename_preprocess_page:

<?php
  if (is_object($vars['styles'])) {
    $vars['styles']->setMagicNumber(25);
  }
?>

Maybe this could even be combined with a variable_get() thing..

Of course this only works with PHP 5.x, but we could add a fallback for PHP 4.

All that said, I'm not sure if this is really relevant.
We should also keep in mind that every new admin setting means added complexity, and needs to be considered for upgrade and downgrade.

klonos’s picture

Yes, either that, or expose it as a per-theme setting (which I kinda lean towards).

donquixote’s picture

It would be interesting to know if we are trying to solve a real-world problem, or just something hypothetical. I can personally live quite well with the number 22. What do you think?