less.php icon indicating copy to clipboard operation
less.php copied to clipboard

Custom functions

Open mryand opened this issue 10 years ago • 2 comments

I am considering migrating from https://github.com/leafo/lessphp, but I'm not seeing how/if it is possible to implement custom Less functions in php, which is a lessphp feature we use heavily.

If it's possible, can someone explain or point to documentation on this in less.php? If it's not possible... I guess I'd like to raise it as a feature request.

mryand avatar Aug 11 '15 21:08 mryand

OK, I can partially answer my question -- some poking around in the history finds this pull request: https://github.com/oyejorge/less.php/pull/115

Which suggests something along the lines of: $parser->registerFunction($name, $callback);

But some clear documentation (if it exists or could be written) about how to write a function, how the data structures work, etc. would still be handy!

mryand avatar Aug 11 '15 21:08 mryand

+1 for this. Custom functions are really usable feature. After hours of research I made the needed custom function, but docs for its are strongly required.

Alexious-sh avatar Aug 20 '15 12:08 Alexious-sh