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

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

Do you only have to install Sass once?

When I install Sass via the terminal, is that a one time thing?

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Natasha,

Yep, you only do that once. :)

5 Answers

The easiest way to run the sass --watch command is to open your terminal and change into the directory you have your project stored and then run sass ---watch input.scss:output.scss. It should look like the following

//From your project directory with no subdirectories
sass ---watch styles.scss:styles.css

//From your project directory with a subfolder for both sass files and css files
sass --watch sass/styles.scss:stylesheets/styles.css

//From your project directory with a subdirectory for both sass and css files
//and you want to watch the sass dir and output to css dir
sass --watch sass:css

The important thing to remember when running the command is that the input:output is actually the path to the file relative to where you currently are in the directory.

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

Thanks Wayne Priestley! And when you say, --watch .

how does '.' – know what file you are referring to? I'm assuming it has to be open?

Wayne Priestley
Wayne Priestley
19,579 Points

Natasha, I think it uses Magic to be honest :)

I don't know how it knows, it just does, I guess it because your talking to the unix code which is the core of the machine, it knows everything thats going on and when you have the application open that your using to code its smart enough to know when you tell it to watch that you mean for it to watch that application.

But I think Magic sounds better :)

Maybe someone could explain it to both of us...

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

haha okay I will take that answer. I tend to over analyze everything!

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

And not sure if anyone knows this but, does CodeKit watch sass automatically? So I don't have to use terminal to tell it to watch anything?