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 trial

General Discussion

Laura Cressman
Laura Cressman
12,548 Points

How many stylesheets should a website have?

I am in the middle of the Sass course, and one of the videos mentioned that many sites have several (if not more) linked stylesheets. I was wondering what the advantages or disadvantages of this were, particularly regarding load time. Should each page have its own stylesheet? It seems redundant especially if for instance the header and footer are common to all pages. Thanks, Laura:)

2 Answers

Stone Preston
Stone Preston
42,016 Points

Having multiple stylesheets does decrease performance slightly as it means more requests, however I would think the organization and readabilty benefit outweighs this decrease in performance. Having one super big stylesheet probably isnt ideal.

Ideally, as few as possible for the purpose Stone states. I would try to be as economical with the resources that I can. Think about whether what you are doing is worth the load time... and make sure to minify your CSS files for good measure. :)

Laura Cressman
Laura Cressman
12,548 Points

I'm still new to this, so does minify just mean make it as concise as possible?

Minifying is a process that removes the spaces and other fluff from CSS and JavaScript. Here's an article about the process: http://www.hanselman.com/blog/TheImportanceAndEaseOfMinifyingYourCSSAndJavaScriptAndOptimizingPNGsForYourBlogOrWebsite.aspx