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

CSS vs SASS

So I thought instead of looking online I wanted a discussion

Which do you think is the best for my idea -->

"So I have a website already written in plain HTML and CSS, I have now been given a task to create a new website to do roughly the same thing as the old one, I have heard of SASS and I like the idea however the other website is written in CSS."

4 Answers

jason chan
jason chan
31,009 Points

SASS is precursor to css. Basically sass compiles to css.

Sass could speed up your workflow. The only benefit I see is that it has access to libraries to burbon and compass.

If your familiar with vanilla css I would stick to it, but you can take a course here on treehouse to see how it goes. SASS is a ruby gem. Might as well learn ruby and ruby on rails.

Isn't Ruby (on rails) for app development more than web design?

Sass is extended css. A sass file could contain only CSS and it would still work. So you don't have to worried about learning a whole new language.

A great thing about Sass (lower case not all caps btw) is that you can break it up into multiple files and folders. This keeps your code really manageable. Forget about scrolling through 100s of lines in a single CSS file.

With sass comes variables, functions and mixins. These are really easy to learn. Even if you just start with simple variables for your colours you'll notice the benefits straight away.

With mixins and functions sass takes out the repetitive nature of css. No more copy and paste.

In short Sass is awesome and you should start to learn about it and use it as soon as you can. There's a great intro course to it on here by the creator of sass!

Sass does need ruby to be installed on your computer so that it can run but you definitely don't need to learn Ruby to use it. The intro course goes through the steps of installing ruby on your computer.

A small project would be an ideal place to start using Sass. Seriously once you've started you'll never go back to a single CSS file.

I know a bit if PHP I guess that would help with Sass Variables?

Exellent answer btw :p

Pete Cass is totally right. Using SASS is amazing, and also if you want a position as a front end dev 9/10 times companies will want someone with a CSS extension language experience. I would give it a try and experiment with it. Treehouse does have a great course on SASS.

Kevin Korte
Kevin Korte
28,149 Points

Great answer Pete!

And Shaun, yes it will help. It's as simple as this in Sass

$red : #FF0000

p {
  color: $red;
}
Konrad Pilch
Konrad Pilch
2,435 Points

So, your saying i should use Sass right now? would be much much better than CSS? and save time?

Kevin Korte
Kevin Korte
28,149 Points

Yes Konrad, there's little reason to not use Sass, other than there is a new kid on the block, called https://github.com/postcss/postcss

But Sass is a timesaver, and valid CSS is valid Sass, so you can use as little or as much of the Sass syntax as you're comfortable with.

Agreed. Everyone who is writing frontend work should know how to uses Sass.

Konrad Pilch
Konrad Pilch
2,435 Points

Nice info! Thank you :) Gonna look forward to it then.

If you have knowledge of any programming language that would be a great start.

For me Sass was an intro into programming languages.

jason chan
jason chan
31,009 Points

Try using prepros to compile sass. I use it.