Last updated 6 October 2015. Created on 13 December 2014.
Edited by cutesquirrel, corey.aufang. Log in to edit this page.


LESS requires at least one of three possible engines available:

  • oyejorge/less.php *

    This is a pure PHP implementation, which is good for shared hosting, or if you don't feel comfortable
    installing or configuring software on your server.

    It lacks the ability to execute javascript embedded in .less files, so some LESS libraries might not work.


    1. Libraries
    2. oyejorge/less.php installed such that Less.php is located at sites/all/libraries/less.php/Less.php
  • less.js

    You can read about how to install here: less.js

    Please read Command Line Requirements to ensure that less.js is installed properly.

  • leafo/lessphp Deprecated *

    leafo/lessphp library unpacked so that is located at sites/all/libraries/lessphp/

    This library is no longer recommended as it lacks support for a majority of new features in the latest canonical LESS.

    Please check #2044643: leafo/lessphp precision issue needs documentation if you experiencing any rounding issues.

Less engines in PHP do not support JavaScript evaluation.

You can read and example here: #1796758: Less implementations in PHP don't support embedded JavaScript




Write your CSS rules without vendor prefixes (in fact, forget about them entirely)

Autoprefixer will use the data based on current browser popularity and property support to apply prefixes for you.

Please read Command Line Requirements to ensure that autoprefixer is installed properly.

Command Line Requirements

Both less.js and postcss/autoprefixer require that PHP can call these programs directly from the command line.

It is up to the installer (you) to ensure that the lessc and/or autoprefixer are able to be called by PHP without a full path to the binary.

Thus is it required that you configure your PATH for the user that your PHP installation runs under to ensure that these programs can be run by name without the full path. (For instance, you can set the PATH in /etc/apache2/envvars, to indicate the bin directory of your node.js, for lessc)

Looking for support? Visit the forums, or join #drupal-support in IRC.