Extension · Mecha CMS

Add extra functionality to the core engine.

Less

Author: Taufik Nurrohman · 3650 Views

Tweet

Convert Less syntax into CSS syntax.

Table of Content

Download Version 2.1.1 Download Development Version

This extension will compile Less code into CSS code by looking for files with .less extension that added to the asset storage by the Asset::set() method and then will store the results into static CSS files with the same name as the source name. Static CSS files will be updated automatically whenever the file modification time of each Less file is changed:

path/to/file.less → path/to/file.css
path/to/less/file.less → path/to/css/file.css

Usage 

Dynamic loading:

Asset::set('path/to/file.less');

Direct loading:

echo Asset::less('path/to/file.less');

Related: Less

Dependency 

Extension