Sass/Compass Compile into Many Locations

Sass/Compass compile into many locations

I wrote a simple shell script to compile to a given path:

echo "* Compiling all CSS"


echo "***** START";
cd /mainworkspace/www/

echo "***** compiling into skin1";
compass compile --time --css-dir=skin1/main/css --output-style compressed --force;

echo "***** compiling into skin2";
compass compile --time --css-dir=skin2/main/css --output-style compressed --force;

echo "***** compiling into uc skin";
compass compile --time --css-dir=uc/main/css --output-style compressed --force;


echo "***** END";

update:
added some params for production. Here you can find many other optional params: http://compass-style.org/help/documentation/configuration-reference/

Compiling sass with SassyStudio and Compass and multiple areas

OK, so the sass --compass is new to me, so I don't know if I can comment on that.

Here is what you want to do.

First, change your ruby path to this C:\Program Files (x86)\Ruby193 as you don't need the bin directory in there (and not sure if it would cause issue or not).

Next, for me to detect that you are using compass (vs sass gem), I look for the config.rb file, and I believe that compass requires this to work as well, but not exactly sure on that. For me though, I definitely need it.

Now, what happens when you save a file is that I go looking for that config.rb from the current directory upward, so I believe that you can achieve what you are wanting to do through the use of multiple compass.rb files. So, that means if you put one in Area 1, one in Area 2, and one in Styles, I think it will work (but I've never tried).

I'm a bit unfamiliar with the syntax of compass.rb but I'm sure you will be able to figure out something that works there. That file may need to go into the Styles folder instead of root folders, I don't remember for sure (I think styles is perhaps configured in config.rb).

Let me know if you need anymore help.

compile one sass/compass file into multiple css files

Not sure how many companies you have but if it's not some insane number, you could probably have:

company1Styles.scss
company2Styles.scss
company3Styles.scss
etc.

Each of those would contain a line like

@import "partials/_company1Vars.scss"
@import "_screen.scss"; // contains everything else

or

@import "partials/_company2Vars.scss"
@import "_screen.scss"; // contains everything else

You could change the variables independently of everything else in your project and get different outputs.

Compiling Compass css files into different directories?

Just place your blog sass files in /sass/themes/blogs/ and watch from /. As long as your files aren't prefixed with an _ they'll be generated in the corresponding location in the css directory (/css/themes/blogs/).

Compass set .css output path to same location as .scss

Silly me (then). Compass does this as well. Just pick the highest parent folder for your project as the sass and css dirs in your config.rb file, and compass will recursively loop through and compile the css into sass in whatever directory it found it.

sass_options = {:cache_location => "./temp/.sass-cache"}
http_path = "/"
css_dir = "therootdirectory"
sass_dir = "therootdirectory"
images_dir = "therootdirectory/assets/images/sprites"
javascripts_dir = "javascripts"


Related Topics



Leave a reply



Submit