21

New to ruby (I usually use python/django), new to sass. I'm simply trying to configure the output css directory option.

Related question here: changing the output directory of the resulting css file in compass webby and here: possible to change the sass compass output folder for different files

Answer to both is to change config.rb. Where is config.rb found? Is there another way to set the options?

Community
  • 1
  • 1
rakitin
  • 1,943
  • 6
  • 25
  • 51

4 Answers4

38

You can simply use:

sass --watch input-dir:output-dir

i.e:

sass --watch scss:css
eneepo
  • 1,407
  • 3
  • 21
  • 32
  • 1
    scss or sass CLI application's help page doesn't say anything about the colon between input dir and output dir. And this works well for my sass v3.4.22 – Eddie May 25 '16 at 23:24
  • This is exactly what I needed. – jkcl Jan 05 '18 at 07:48
16

config.rb is specific to Compass projects and is located in the root of your project. If you are using Compass, you can specify css_dir to your liking keeping in mind that / is root of your Compass project.

css_dir = "/assets/css"

If you are using just Sass, you can specify the output path when compiling.

sass input.scss ../path/to/output.css
maxbeatty
  • 9,050
  • 3
  • 33
  • 36
  • uhm I'm having the same problem, but not sure how to use your answer, I have a scss folder and a css folder, but for some strange reason sass is outputting into a stylesheets folder :( – Leon Gaban Jun 01 '13 at 22:09
  • It's hard to help without knowing more about your project. How are you compiling your sass? – maxbeatty Jun 02 '13 at 14:48
  • 1
    Is there any way, to do this without Compass? – ts_pati Mar 04 '14 at 13:53
  • @ts_pati the second code snippet is for the Sass command line tool that takes your input file as the first argument and a path to the output file as the second argument – maxbeatty Mar 04 '14 at 17:35
3

Open config.rb in a text editor and change "css_dir" from "stylesheets" to "/" (see below)

   http_path = "/"
   css_dir = "/"
   sass_dir = "sass"
   images_dir = "images"
   javascripts_dir = "javascripts"
mattc
  • 47
  • 5
0

You can also use koala app(http://koala-app.com/) to change the css output direcctory. i think this is simplest method. 1. Install Koala app 2. Run and add both directories in Koala interface and refersh.

enter image description here