phpsass icon indicating copy to clipboard operation
phpsass copied to clipboard

Extensions method - add compass

Open tsi opened this issue 12 years ago • 10 comments

Since #4 was closed -

You mention there the Extensions method from the original Phamlp.

the extensions method has been temporarily removed ... We will be adding them back in once we have fixed on a way to do it properly.

Did you ever got to that ? if not, any hint on what was removed and what should be done ? I'd like to help with that. I'm looking to be able to add compass as it was in the original phamlp, without listing all the functions etc.

tsi avatar Dec 20 '12 09:12 tsi

Hi, right now I'm trying to implement compass from Drupal sassy but I don't understand how should I work with load_path and load_path_functions.

For example, If I do a single php file and I define myurl($param) in the same file that I make an instance of SassParser($options) with $options = array('functions'=>array('myurl'=>'myurl')); it works as expected and function myurl($param) returns the expected result 'test'.$param

But I trying to define function in other file called myownfunctions.php in the same directory. I don't do and require_once or something like that but I think that this is something that is done by 'load_paths' then i put in $options 'load_path' => array('/path/from/myfile.php'). I also tried with 'load_path_functions' instead of 'load_path' and the result is the same. The generated css code returns 'body:{ background: myurl('h.gif') }' instead of 'body:{ background: 'testh.gif' }'

Could any one help me with this?

jmverges avatar Dec 20 '12 11:12 jmverges

I hope that today I can share Compass for Phpsass with everybody ^^

jmverges avatar Dec 21 '12 07:12 jmverges

Oh that would be awesome! and I might even be able to help you improve it since I did some work on the original Phamlp version of compass.

tsi avatar Dec 21 '12 09:12 tsi

tsi, it is based on Drupal Sassy Compass, but all improvement is appreciated

jmverges avatar Dec 21 '12 11:12 jmverges

I hope that I could upload it tomorrow, sorry for the delay

jmverges avatar Dec 21 '12 18:12 jmverges

https://github.com/jmverges/compass-phpsass

jmverges avatar Dec 22 '12 16:12 jmverges

I got very excited, but I couldn't replace my phamlp with this. I didn't dig to much into this, it's hard to find the time. Do you have it working? how is it set up with phpsass? Maybe this is related - in your example.php, the $compass variable is left unused. Thanks!!

tsi avatar Dec 25 '12 16:12 tsi

Scratch that. It's working! My set-up varies from yours in a few places so I had to modify your examples a bit but all in all it seems to work, at least with simple stuff like border-radius (got some syntax issues with gradients). I'll open any further issues on you repo. Thanks a lot, you just made my week :)

tsi avatar Dec 25 '12 18:12 tsi

Iep! I had to update it in my repository. I did a pull request with the new code to richthegeek that I hope that he accepts. I will be updating my repository in a few hours. I had some mistakes that I solved now. Enjoy it :-)

jmverges avatar Dec 25 '12 21:12 jmverges

The Extensions support looks incomplete.

In Extensions/example.php, I see:

            'functions' => getFunctions(array('Compass','Own')),
            'extensions' => array('Compass','Own')

I would expect to use $options['extensions'] -- instead of $options['functions'] and getFunctions() -- but it isn't used anywhere else (e.g., SassParser).

robocoder avatar Feb 21 '13 16:02 robocoder