Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBuckley Perkes
2,705 Points@import? what are the advantages and when would you actually use it...
I just finished the introduction to CSS and they introduced @import as a way to import CSS styles... Would there ever be an advantage to using this over simply adding an additional <link> to your second CSS file?
Buckley Perkes
2,705 PointsCool. Thanks!
Mike Bronner
16,395 PointsI would use @import in frameworks that don't have special CSS handlers. For example, WordPress has a special methods to include stylesheets, so in that case I wouldn't use @import.
1 Answer
James Barnett
39,199 PointsThere is a downside to @import
http://www.stevesouders.com/blog/2009/04/09/dont-use-import/
Mike Bronner
16,395 PointsThanks for that interesting article, James!
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsFor larger projects with lots of CSS easier to manage in production. Also used alot in SASS the CSS precompiler.