Michael Barley
Michael Barley

Reputation: 179

How do I compile sass code into a css file in another directory?

I want to incorporate the SMACSS architecture into a site that I am building.

On my desktop I have a folder named after the site which I am building. Containing my css,js images and sass folders.

All the contents of the sass folders are partials which I import into a main.scss file(contained within the sass directory).

Here is my sass directory:

sass/
|
base
| _ file.scss
| _ file1.scss
|
layout
| _ file.scss
| _ file1.scss
|
module
| _ file.scss
| _ file1.scss
|
state
| _ file.scss
| _ file1.scss
|
theme
| _ file.scss
| _ file1.scss

I want to compile my main.scss file into a file called stylesheet.css which should be inside the css folder.

I have tried:

sass --watch main.scss:stylesheet.css

With no luck.

Upvotes: 3

Views: 7005

Answers (1)

markoffden
markoffden

Reputation: 1468

You are executing sass relatively to current directory, so keep it in mind, and enter path to your files according to it:

sass --watch main.scss:../css/stylesheet.css

Or call sass from the root of your project:

sass --watch sass/main.scss:css/stylesheet.css

Upvotes: 5

Related Questions