Less by Ryan Cramer, bernhard

A module wrapper for Wikimedia’s Less parser that compiles .less files to .css. Also used by the ProcessWire core for AdminThemeUikit customization.

Less parser for ProcessWire

This is a ProcessWire module wrapper for the Wikimedia LESS parser. Originally developed by Bernhard Baumrock with additions by Ryan Cramer. Requires ProcessWire 3.0.164+.

Install


  1. Copy all files included in this module into new directory /site/modules/Less/.
  2. In the ProcessWire admin, go to Modules > Refresh.
  3. Click install for the Less module.

API usage


Compile string and two .less files to a css file

$less = $modules->get('Less');
$less->setOption('compress', true);
$less->addStr('@color: #4D926F; h2 { color: @color; }');
$less->addFile('/path/to/file1.less');
$less->addFile('/path/to/file2.less', '/url/to/images/');
$less->saveCss('/path/to/file.min.css');

Access Wikimedia less parser directly

$parser = $less->parser();
$parser->parseFile('/path/to/file.less');
$css = $parser->getCss();

For details about API methods you can access from $parser see: https://github.com/wikimedia/less.php

Usage with ProcessWire’s AdminThemeUikit module


Install this module to add the ability to customize the ProcessWire core AdminThemeUikit admin theme module CSS. For this usage, you must have ProcessWire 3.0.179 or newer. See instructions here: https://processwire.com/blog/posts/pw-3.0.179/

License


This module uses the Apache license for consistency with the Wikimedia LESS parser license.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • ProcessWire 3.0.180 core updates– More
    18 June 2021
  • Today a new version of FormBuilder has been released in the FormBuilder support board (our 50th version) and it has a lot of interesting new features, which we’ll take a closer look at in this post— More
    11 June 2021
  • ProcessWire 3.0.179 adds great new admin theme customization tools that put you in full control over the Uikit admin styles— More
    28 May 2021

Latest news

  • ProcessWire Weekly #371
    In the 371st issue of ProcessWire Weekly we'll check out ProcessWire 3.0.180, introduce a new module called Flowti Page Serializer, highlight some recent forum posts and tutorials, and more. Read on!
    Weekly.pw / 19 June 2021
  • ProcessWire FormBuilder v50 updates
    Today a new version of FormBuilder has been released in the FormBuilder support board (our 50th version) and it has a lot of interesting new features, which we'll take a closer look at in this post.
    Blog / 11 June 2021
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.