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

I look around and it seems that the problem is quite common, but I can’t find a solution for my business.

I created my first Compass project after these instructions

My folder project is called sass-test

I have css files

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

My config.rb inside is configured this way

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

Then I have a sass folder with:

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

I make some changes to my screen.scss file and then compile it using the terminal providing this command

 compass compile sass-test/sass/screen.scss 

Now it happens that COMPASS automatically creates new folders

  • style sheets
  • test
  • bicker. In this folder, Compass compiles screen.css

I do not want my screen.css file to be compiled, but I want it to be inside my sass test, where the screen.css file already exists.

How can i achieve this? I also look through this article for an article that reads all the comments, but I cannot understand this problem.

I also tried to compile it using the liveReload preprocessor setting the output folder, but it still compiles screen.css on the “wrong” path.

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

Here is the print screen enter image description here

thanks

+4
source share
4 answers

Well, I figured out this problem, I start from the very beginning to call the project in a different way (without a hyphen), then I configure the output folder using the LiveReload preprocessor and at any time edit any scss file, it compiles directly to the relative css file in the folder stylesheet. So I do not use any command line

+1
source

You need to change css_dir = "stylesheet" in your config.rb to indicate where you want to compile the CSS files. In your case, it looks like what you want here:

 css_dir = "./" 

You will probably also need to include relative URLs.

+2
source

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

 cd sass-test compass compile sass/screen.scss 

Or just the compass compile command to compile all the files.

+1
source

It can also help if you want to have different default values ​​for what uses the compass of folders every time (one of them just edits your config.rb)

edit / add the following to your ~ / .bash_profile file

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

All Articles