I want to add Compass to my existing project. I want to maintain my current project structure, which looks like this (simplified):
app/
build/
|-compass/
assets/
|-css/
|-scss
|-js/
|-img/
So I want all my SASS files under \assets\css\scss and I want to output the compiled CSS files to \assets\css.
Running:
compass create --bare --sass-dir "assets\css\scss" --css-dir "assets\css"
creates the Compass config.rb file directly under my root.
However, I want the file to be under \build\compass.
- How can I control where Compass creates the config.rb file?
- Compass documentation says that declarations in config.rb (e.g. css_dir, sass_dir, etc.) are all relative to the project_path. Where do I define the project_path?
I don't see why you'd structure a project like this...I mean why not put the scss in build and then everything in assets can be deployed for production?
So: 1. Running (from "app" directory)
will create the project folders and files as such:
compass config "build/config.rb" --http-pat="../" --sass-dir="compass/scss" --css-dir="../assets/css" --javascripts-dir="../assets/js" --images-dir="../assets/img"
will simply create the build directory and place a configuration file with these values in it.
This is an example of config.rb:
And with this config.rb settings, your project folder should be like (as you wrote):
If you don't have a config.rb, simply create a new file "config.rb" and copy/paste inside the configuration i wrote.
Open your terminal, enter in MyFolder/build/compass and then start your compass command, like:
compass watch
Remember
You have to execute your compass command in the same folder where is the config.rb file. So in this case in MyFolder/build/compass. Otherwise compass doesn't work.
Compass creates the config.rb in the same directory as where you ran the command from. The project path is where the config.rb resides. You're free to place config.rb wherever you like, as long as you adjust the paths for your assets.