Koala7
Koala7

Reputation: 1404

How to set the path to compile my CSS with Compass SASS

I have been looking around and it seems an issue quite diffused, but i am not finding the solution for my case.

I have set up my first Compass Project following these instructions

My folder project is called sass-test

I have my css files

My config.rb inside is set up in this way

http_path = "/"
css_dir = "stylesheet"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

Then I have my sass folder with:

I do some changes in my screen.scss file and then i compile it by the terminal giving this command

compass compile sass-test/sass/screen.scss

Now it happens that the automatically COMPASS generates new folders

I dont want my screen.css compiled there but i want it inside my sass-test where there is already existing the screen.css file.

How can i achieve that? I also look up in this article reading all the comments but i can not figure it out the issue.

I have also tried to compile it by liveReload preprocessor setting up the Outputfolder but it's still compiling the screen.css in the "wrong" path.

how can i give the instructions to Compass to compile my screen.css file in my sass-test?

Here the print screenenter image description here

Thanks

Upvotes: 4

Views: 20915

Answers (4)

John Smith
John Smith

Reputation: 1814

This may also help, if you wish to have different defaults for what folders compass uses, everytime (one off just edit your config.rb)

edit/add the following to your ~/.bash_profile

alias compass_init="compass init --syntax=sass --css-dir=css --javascripts-dir=js"

Upvotes: 0

piouPiouM
piouPiouM

Reputation: 5037

Because all paths defined in the project configuration file are relative to the current shell path, you must run the command compass from the root of your project, that is to say, since the directory sass-test:

cd sass-test
compass compile sass/screen.scss

Or just the command compass compile to compile all files.

Upvotes: 1

Koala7
Koala7

Reputation: 1404

Ok i have sorted it out the issue, i start from the beginning calling the project differently ( without any hyphen) then i set up the output folder by LiveReload preprocessor and anytime i edit any scss file, it compiles straight to the relative css file inside the stylesheet folder. In this way i do not use any command line

Upvotes: 1

cimmanon
cimmanon

Reputation: 68319

You need to change the css_dir = "stylesheet" in your config.rb to point to where you want the compiled CSS files to go. In your case, it sounds like you want it here:

css_dir = "./"

You'll probably need to enable relative URLs as well.

Upvotes: 2

Related Questions