Documentation for the LESS CSS Preprocessor module.
This module will automatically process any LESS files that are added using drupal_add_css or added through your module/theme's .info file.
Add your files just like any other .css file, just with .less as the extension, and they will be automatically processed.
- Libraries API.
- lessphp library unpacked so that 'lessc.inc.php' is located at 'sites/all/libraries/lessphp/lessc.inc.php'.
If your source file was "sites/all/modules/test/test.css.less"
Then your compiled file will be "sites/[yoursite_or_default]/files/less/[random.string]/sites/all/modules/test/test.css"
The following two examples provide equivalent functionality.
$module_path = drupal_get_path('module', 'less_demo');
drupal_add_css($module_path . '/styles/less_demo.css.less');
stylesheets[all] = styles/less_demo.css.less
Should work with most themes and caching mechanisms.
Fully compatible with "Optimize CSS files" setting on "Admin->Site configuration->Performance" (admin/settings/performance).
RTL support will work as long as your file names end with ".css.less".
Assuming your file is named "somename.css.less", Drupal automatically looks for a file name "somename-rtl.css.less"
Confirmed to work with: