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

CSS

What is Sass?

Hey! I've been working my way the course on how to make a website. Currently, I'm on the last stage - Sass basics - but I'm having difficulty wrapping my head around its purpose.

So far I understand that it essentially condenses repeated CSS. Which helps with DRY. So far that's what I have taken from the lesson. But I'm not 100% sure.

Any thoughts?

Thanks

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Sass does a lot of things, actually, it can get pretty complicated. Some of the more useful and commonly used features for me is Sass can do variables, which is great for colors, padding, ect. The other really powerful feature is that the includes feature is actually usable, so you can break your files up into smaller files, and use the Sass include feature to rebuild a larger CSS file at compile time.

It does a lot of other cool things like functions, mixins, extends, loops, etc. I don't every get into a lot of those, but on larger projects I could see how it could be useful. I don't build a website anymore without Sass though, it's that helpful. Since its a preprocessor it doesn't have any affect on page load time, actually it can help because you can use Sass to compile a minified version of your CSS, so you get the comment heavy, full of white space readable Sass file to work with, and you give the browsers a lean, mean, comment free CSS file.

Sass is also pretty newb friendly, once it's set up, since valid CSS is valid Sass, so you can use as much or as little of the Sass syntax as you want in your Sass files.