Skip to content

Instantly share code, notes, and snippets.

@schankam
Last active August 29, 2015 14:04
Show Gist options
  • Save schankam/5fad9589e65ced803c3d to your computer and use it in GitHub Desktop.
Save schankam/5fad9589e65ced803c3d to your computer and use it in GitHub Desktop.
LESS installation on Drupal 7.x

Global overview

This document gives you all the needed steps to deploy the [LESS css pre-processor] (http://lesscss.org/ "LESS css pre-processor") on your Drupal installation. The following given commands assume that you have Drush installed.

Getting the Drupal LESS module

To achieve this, you only need to go into your Drupal installation folder and type:
drush dl less to download the LESS module
drush en less -y to enable the LESS module

Getting the Lessphp library

To have a working less installation, you will need to go to your "DRUPAL_ROOT/sites/all/libraries" folder (if the libraries folder does not exist yest, just create it), and to extract the Lessphp library into it. You should have something like *DRUPAL_ROOT/sites/all/libraries/lessphp/lessc.inc.php".

Turning LESS into developer mode

In your Drupal back-office, go to the following URL "/admin/config/development/less", then check "LESS developer mode" and uncheck "LESS watch mode". These settings will allow Less to regenerate files on every request. Please also make sure that your "files" directory has sufficient permissions.

Note: Do not forget to turn off the developer mode when putting your website on the production environment.

You are now ready to use LESS with Drupal 7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment