LESS Module/Theme Usage

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

Usage

The following two examples provide equivalent functionality.

drupal_add_css():

drupal_add_css(drupal_get_path('module', 'less_demo') . '/styles/less_demo.css.less');

.info file:

stylesheets[all][] = styles/less_demo.css.less

By default all files added through the above .info method have any variables associated with the module automatically available when the .less file is compiled.

For automatic variable association with non globally added stylesheets, you can associate a stylesheet using this notation in .info files:

less[sheets][] = relative/path/to/stylesheet.css.less

Help improve this page

Page status: Not set

You can: