Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using @import declarations a bad practice? [duplicate]

Tags:

css

Possible Duplicate:
Difference between @import and link in CSS

I've read about CSS @import as a bad practice, and was wondering about the methods I'm using.

I'm currently building a website using WordPress, which imports each plugin's stylesheets by link references, and the main stylesheet is linked in the same manner, however, the main stylesheet currently contains several @import declarations, which I believe I should be moving into the header or into the appropriate pages that they're used in (having two of them are only used on certain pages).

Are my concerns justified, and what are the implications of using those @import declarations?

like image 757
Jack Avatar asked Jul 29 '12 13:07

Jack


People also ask

Is@ import CSS bad?

It is best to NOT use @import to include CSS in a page for speed reasons. importing allows you to import one style sheet into another. This is slightly different than the link scenario, because you can import style sheets inside a linked style sheet.

What is the use of @import at rule?

Definition and Usage The @import rule allows you to import a style sheet into another style sheet. The @import rule must be at the top of the document (but after any @charset declaration). The @import rule also supports media queries, so you can allow the import to be media-dependent.


1 Answers

The web provides a lot of information about this topic, I suggest reading:

  • http://www.stevesouders.com/blog/2009/04/09/dont-use-import/
  • @import vs link
  • @import or <link> for importing stylesheets?
like image 190
poitroae Avatar answered Sep 28 '22 04:09

poitroae