As of http://code.google.com/intl/de-DE/speed/page-speed/docs/rtt.html#AvoidCs... Drupal 7 should not use @import to import the css files.

Comments

Damien Tournoud’s picture

Status: Active » Closed (works as designed)

@import is used only in non-CSS aggregation mode. This is done to workaround IE limitation with the number of <style> tags.

jbrown’s picture

That link is referring to @import in external stylesheets, not in the html.

I grepped the codebase and @import is not present in any CSS file.

gagarine’s picture

Title: Don't use @import to import css files » CSS added with @import are downloaded sequentially on IE
Category: feature » bug
Status: Closed (works as designed) » Active

CSS added with @import are downloaded sequentially on IE 6 7 8:

"@import has a negative impact on web page performance"
http://www.stevesouders.com/blog/2009/04/09/dont-use-import/

"In IE @import behaves the same as using
at the bottom of the page, so it's best not to use it. "
http://developer.yahoo.com/performance/rules.html#csslink

So what should we do? We can display a warning if we go over the IE limitation? Or only use @import if we pass over the limitation (but when exactly downloading sequentialy is bad)?

What about using link for the first 28 CSS and after @import? This give 4 "spear" in case of hard coded CSS in tpl.

First we should certainly have less CSS! Lot of modules provide useless CSS than everybody overwrite...