On this page
LESS Engines
Requirements
LESS requires at least one of three possible engines available:
-
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.
Requirements:
- Libraries
- oyejorge/less.php installed such that
Less.phpis located atsites/all/libraries/less.php/Less.php
-
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
lessc.inc.phpis located atsites/all/libraries/lessphp/lessc.inc.php.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
Optional
Autoprefixer
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)
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion