Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
What are the other ways to optimize css ?
Other than Avoid @import and using Hosted Services, in which ways can we optimize our css ?
Kevin Korte28,111 Points
If you have multiple stylesheets, you can compile them into one bigger stylesheet. This makes fewer http requests, and so generally will load faster. You can also compress your css files, which strips out comments, line breaks, and any white space. This makes file size smaller, and fewer lines and characters to parse so it'll also help make the file load faster.
Both of these I do not recommend doing manually. There are great tools that can automate these tasks for you, like CSS pre-processors like Sass, Less, or Styles, and build tools like Grunt and Gulp.
Also to note, @import as sass file is perfectly fine. @import in a css file sucks. Because @import in a sass file runs at compile time, not load time, it won't affect page load speed. In fact, @import in a pre-processor like Sass is a great way to compile many smaller css files into one larger one.
Is it really necessary to learn "SASS" on the path of becoming a front-end-developer? What are the things I'll know after learning SASS?