About RockLESS

Module to parse LESS files via PHP.

Category Development Tools
Modules that have more to do with assisting development of a site rather than managing its content.
Release StateBeta
Close to stable, but users are advised to be cautious and test thoroughly.*
Module Version0.0.1
Class NameRockLESS
Date AddedJanuary 13, 2019
Last UpdatedJanuary 15, 2019
Recommended ByNew recommendations may take up to 1 day to appear.


This module's files should be placed in /site/modules/RockLESS/
How to install or uninstall modules



This is a helper module for parsing LESS and returning the resulting CSS file or content. It checks the LESS file for changes and recreates the CSS file only when needed. See the comments in the module file for options.

This is an exemplary return of the getCSS() method:

example object

And this is how you can use a less file as theme in your HTML markup:

<link rel="stylesheet" type="text/css" href="<?= $modules->get('RockLESS')->getCSS($config->paths->templates . 'less/theme.less')->cssUrl; ?>">

Send php variables to LESS:

$less = $modules->get('RockLESS');
$less->vars = [
  'foo' => 'bar',
$css = $less->getCSS($config->paths->templates . 'less/theme.less')->cssUrl;
echo "<link rel='stylesheet' type='text/css' href='$css'>";