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 CSS to Sass Installing Sass and Setting up the Project The --watch Command

Bruno Dias
Bruno Dias
10,554 Points

Watch scss changes and save css in the same directory

This tells Sass “watch all the Sass files in the scss directory for changes, then update the style sheet inside the css directory.”

sass --watch scss:css

What if I want to save my css file in the same directory as my scss file? How can I write that command?

3 Answers

nguyen manh
nguyen manh
16,824 Points

You can run this command sass --watch style.scss. It'll create style.css in same folder.

Leigh Maher
Leigh Maher
21,830 Points

What if I want to output the style.css to the root of my project folder e.g. I have a project folder with a scss folder inside it but I want the style.css to output to the root of the project folder i.e.

Scss here: Project fodler > scss > style.scss

Output here: Project folder > style.css

Thanks.

nguyen manh
nguyen manh
16,824 Points

On root folder -> open terminal -> command:

sass --watch scss/style.scss:style.css

I recommend cool app for complie sass file, easy to use Prepros

Leigh Maher
Leigh Maher
21,830 Points

Thanks Nguyen. I was certain I had tried exactly that, but obviously not! It worked this time : )