Jakub Przyborowski
Jakub Przyborowski

Reputation: 73

Is there any way to use Compass with PHPSass compiler?

Our stylesheets are build in SCSS with Compass mixins. For development we used CodeKit as it's great tool and I really love it. But now we need to implement tools for auto compilation on server side. We used PHPSass (phpsass.com) as it supports pure SASS very well. Unfortunately, I have no idea how to attach Compass into it. It does not have build in support yet and Compass is available only as gem package - no way to just download it and put its mixins into project folder. Do someone have any experience with such problem?

Upvotes: 1

Views: 1411

Answers (2)

Rocket Spaceman
Rocket Spaceman

Reputation: 343

Just so everyone knows, as of February 11th 2013, phpSASS supports extensions. A post from the developers twitter, "We now have support for extensions, which means Compass. Big thanks to Juan Manuel Vergés Solanas and tsi for the contributions!" http://www.phpsass.com/ https://twitter.com/PHPSass

Upvotes: 3

Doug Cassidy
Doug Cassidy

Reputation: 1907

Grab the mixins from https://github.com/chriseppstein/compass/tree/stable/frameworks/compass/stylesheets (i think i actually downloaded the compass from some windows/ruby thing) Caution, not all of compass will work with phpsass. im currently using a very small subset, i think the border-radius and box model. there seems to be an issue with some sass functions not ported to php.

$loadpath = array(pathtosassfiles, pathtocompass);
    $defaultOptions = array(
    'load_paths'     =>   $loadpath  ,
    'cache'          => false,
    'syntax'         => 'scss',
    'extensions'     =>  array('compass'=>array())
    );
$debugoptions = array(
    'line_numbers'   => false,
     'debug_info'    => true,
    'style'          => 'nested', //'compressed' 'compact' 'expanded' 'nested'
    );
$minoptions = array(
    'line_numbers'   => false,
    'debug_info'     => false,
    'style'          => 'compressed', //'compressed' 'compact' 'expanded' 'nested'
    );
//then when you instantiate:
$sass = new SassParser(array_merge($defaultOptions, $minoptions));

Upvotes: 1

Related Questions