Hi!

I'm using an Aegir environment. It supposes using a separate system account for manipulating files. So web server account has no access to the compass command.

This makes leveraging Sasson's Compass compilation impossible. I have to compile manually.

But i don't fully understand Sasson logic, so i fail writing an appropriate Compass config.rb file.

So could you please make it?

A Compass-powered theme is kinda incomplete without it. Aurora has one, and so does Zen.

CommentFileSizeAuthor
#8 config.rb_.txt1.64 KBtsi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tsi’s picture

Servers that can't compile Sass is one of the biggest issues we think about since we started developing Sasson.
The most obvious solution we have in Sasson is using the built in PHP compiler, but in Sasson v3, since we want Compass (ruby) compiler as our default compiler things are a bit more delicate because this means keeping things compatible with two different compilers.
At the moment (and things should become even more flexible until v3.0 is released) you have two options:
1. Use the php compiler -
pros: this should work on every server that can run drupal.
cons: the compiler (especially the Compass part) will never be as good as the original, but we still didn't finish working on the php compiler that will ship with Sasson v3 and things should be much better by the time we release (otherwise it will not be included in Sasson).
2. Work locally with the ruby compiler -
This is how we work, we develop locally and push the compiled CSS to the production server - if the compiler is off in the theme settings form, Sasson will look for compiled css files in your /files directory or in your theme directory, right next to the original sass file.
So if you work locally, let Sasson compile your Sass files into your /files directory and then push the files to your production server (where the compiler is off) things should work fine.

This is very much open for discussion and I would love to get some ideas here.

lolmaus’s picture

> So if you work locally, let Sasson compile your Sass files into your /files directory and then push the files to your production server (where the compiler is off) things should work fine.

Great! So why not imprint that in a config.rb?

tsi’s picture

The way Sasson (3.x) works today means that the config.rb is created dynamically in your /files directory (you can actually find it there yourself, there is one per theme under /sasson/themename) with the settings you set in your theme settings form.
If we add a static config.rb file to the theme directory -
1. it will override what you have set in your theme settings
2. you will have to compass watch every time you start working while today you don't have to think about that, just refresh the page.

If you work locally the way I said, on a server that has ruby and compass installed, what is the issue? why not let Sasson compile the way it should?

lolmaus’s picture

> 2. you will have to compass watch every time you start working while today you don't have to think about that, just refresh the page.
> If you work locally the way I said, on a server that has ruby and compass installed, what is the issue? why not let Sasson compile the way it should?

I explained in my initial message why i can't call `compass` from the theme. TL/DR: `www-data` user has no Ruby installed.

tsi’s picture

I got that, but what I suggested is that you develop on a server that allows you to do that, then push the site to production with the already compiled css.
if it helps, you can check out function sasson_parse_compass() on sass.inc around lines 240. This is where the compass commands (create and compile) are constructed according to what you have set in your theme settings, you can print those to screen and then you will be able to run those manually, but there must be a better solution.

lolmaus’s picture

I reinstalled RVM as multi-user. This enables using `compass` for any user but when logged in via `sudo su -s /bin/bash - [username]`. When logged in via `sudo su [username]`, Ruby is still not available. Thus, Sasson produces `sh: compass: not found`.

Also, no `config.rb` appears under `sites\all\example.com\files`. :( Could you please quote its contents?

As long this is a feature request thread, i suggest shipping a `config.rb.example` file that is supposed to be renamed when a user wants to run `compass watch` manually.

lolmaus’s picture

PS RVM is a very popular method of installing Ruby.

And `compass watch` is the simpliest way of using SASS. Recommended by this Drupalcon session: http://denver2012.drupal.org/program/sessions/using-sass-compass-drupal-...

tsi’s picture

FileSize
1.64 KB

The biggest problem with allowing you to compile manually will be the tokens - sasson uses tokens in the css to be replaced with what you set in theme settings. so if you don't go through Sasson's compilation process, these tokens will be passed to the compiler and probably break it.
What we need is this:
1. Take all the tokens out into a separate partial that can be easily excluded if not compiling with Sasson.
2. then we can add a config.rb.example that will allow running compass watch.

Stuff to figure out:
1. How do we handle different themes ? do we watch them all or do we treat every theme as a separate compass project ?
2. Where do we write the CSS to ? /files directory or /themes directory ?

I'm attaching a sample config.rb, it wasn't tested but I've added a lot of comments so you can tweek it if something is not right.

PS about that Drupalcon session, I guess they never heard about Sasson :)

lolmaus’s picture

Never mind, i've switched to Boron: a much purer solution. That pleasant feeling of having everything under control! (rather than dealing with stuff you don't fully control and don't fully understand)

tsi’s picture

Yap, Boron is great if you only want the html5 templates.

tsi’s picture

Component: Code » Documentation

edited: not relevant anymore

tsi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Cleaning up.
Pretty much everything I've written here is outdated.
Sasson v3.x now uses Sass & Compass the Ruby way and is much more powerful You are welcome to try it online.