Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the lessphp library from Leafo.net (http://leafo.net/lessphp/) does not support updated LESS features like extends, a common error I was having. After a bit of research, it seems that leafo.net features are far behind that of gpeasy.com, which is being actively maintained.
I switched it out and it's running beautifully, even using extends. I started writing a drush patch to download the library.
http://lessphp.gpeasy.com
https://github.com/oyejorge/less.php
Comment | File | Size | Author |
---|---|---|---|
#3 | oyejorge-compiler-2221237.patch | 1.82 KB | alexkb |
Comments
Comment #1
alexkb CreditAttribution: alexkb commentedUsing the latest bootstrap, I was having lessphp compile errors along the lines of:
Parse error: failed at &:extend(.clearfix all);
As per this issue report on github the gpeasy.com (aka as oyejorge/less.php) does indeed solve this particular problem, so +1 to @kyletaylored's suggestion to switch!
Comment #2
Nilard CreditAttribution: Nilard commentedhttp://lessphp.gpeasy.com/#integration-with-other-projects
This worked for me.
Comment #3
alexkb CreditAttribution: alexkb commentedAttached is a patch to update the less modules docs and hook_requirements() with the more reliable LessPHP compiler from gpeasy.
Someone will also need to update the Less module project page too.
Comment #4
alexkb CreditAttribution: alexkb commentedComment #5
corey.aufang CreditAttribution: corey.aufang commentedI'm in the process of adding in multi-compiler support.
I will be directing users to visit the project page for a list of compatible compilers and making the hard-coded documentation within the module itself more generic since its easier to make a change to the project page than it is to the module code.
This is related to #2003628: Add ability to use node.js version of LESS.
Comment #6
corey.aufang CreditAttribution: corey.aufang commentedComment #7
kyletaylored CreditAttribution: kyletaylored commentedIs it really related? It just seems more like a drop-in replacement for the current PHP LESS compiler rather than adding a new kind of compiler. Leafo just isn't being kept up as well as gpeasy.
Comment #8
corey.aufang CreditAttribution: corey.aufang commentedIts related from a code perspective.
I'm changing some of the wrapper code that handles which library to use, and adding support for oyejorge/less.php.
When I had last checked there were issues with complete functional parity between leafo and oyejorge.
I will test again and update the project page to reflect my results.
The update to the project page will not wait until after the update to the module code if everything is working, but it will wait till after I'm not at work.
Comment #9
markhalliwellI agree, there needs to be support for both (backwards compatible and existing projects that use Leafo/lessphp).
That being said, it should probably be the default moving forward. FYI, it would probably be beneficial to also add Composer support http://lessphp.gpeasy.com/#installation
Comment #10
corey.aufang CreditAttribution: corey.aufang commentedSpent several hours going through and adding support for oyejorge/less.php, and #2203549.
Ran into an issue that prevent source maps from being generated correctly.
Logged the issue at the following:
https://github.com/oyejorge/less.php/issues/127
Once that issue is resolved, I will be able to complete this functionality.
Comment #11
corey.aufang CreditAttribution: corey.aufang commentedI've also changed the links on the project page to point to http://lessphp.gpeasy.com/#integration-with-other-projects
Comment #13
corey.aufang CreditAttribution: corey.aufang commentedDocumentation pages have also been pointed to oyejorge/less.php.
Comment #14
corey.aufang CreditAttribution: corey.aufang commentedI've updated the information in composer.json to use references to oyejorge/less.php.
I've also attempted to use the following to have the default install path be the libraries folder:
I have yet to get it to actually install to that location.
Is this a Drush only extension or something?
Any help on correctly configuring and testing changes to composer.json would be appreciated.
Comment #17
corey.aufang CreditAttribution: corey.aufang commentedMarking this as fixed as 7.x-4.0 will be released soon.
Documentation has been updated in the README and on documentation pages.
Composer support has also been updated.
Additionally, support for leafo/lessphp has not been removed.
If there are any other issues with integration between the module and one of the PHP engines, please open a new ticket.
Comment #19
kingfisher64 CreditAttribution: kingfisher64 commentedleafo/lessphp is still default despite it not being recommended. Perhaps change default to the library on http://lessphp.gpeasy.com/.
This is in latest stable version.