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

20,451

Solution 1

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

Solution 2

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.

Solution 3

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.

Share:
20,451
Koala7
Author by

Koala7

A designer turning into developer. I am currently worked as Front end React Developer Available for contract works

Updated on July 09, 2022

Comments

  • Koala7
    Koala7 almost 2 years

    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

    • screen.css
    • print.css
    • ie.css
    • config.rb

    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:

    • screen.scss
    • print.scss
    • ie.scss

    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

    • stylesheet
    • test
    • sass .In this folder Compass compiles screen.css

    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