Less Compiler

Less Compiler

"LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the client-side (IE 6+, Webkit, Firefox) and server-side, with Node.js and Rhino." - LESScss

This package utilizes the LessPHP library for compiling.

Directions

  1. Create a less directory in the root of your active theme
    • Create less files in the working directory pattern you would like
  2. Click compile.
  3. Include the helper and add the css in your theme's header.

Compiling

 yourtheme > less > styles > style.css 

Becomes

 files > css > style.css 

Helper functions

link(file1,file2[,fileX...])

Output the linked html of all inputed paths (relative to files/css) indiscriminately.

Example:

 $less = loader::helper('less','less_compiler');
echo $less->link('test.css','test.less','style.css');

~~~~~~~~~~~~
OUTPUT
~~~~~~~~~~~~
<link rel="stylesheet" type="text/css" href="http://yoursite.com/files/css/test.css">
<link rel="stylesheet" type="text/css" href="http://yoursite.com/files/css/style.css">

add(file1,file2[,fileX...])

Add all inputed paths (relative to files/css) to the renderers queue indiscriminately.

Example:

 $less = loader::helper('less','less_compiler');
$less->add('test.css','test.less','style.css');
print_r($less->queue);

~~~~~~~~~~~~
OUTPUT
~~~~~~~~~~~~
Array
(
    [0] => http://yoursite.com/files/css/style.css
    [1] => http://yoursite.com/files/css/test.css
)

renderCache()

Render the cache into link tags.
Calling this function is the same as using the object as a string.
Echoing the output of this function is the same as invoking the object.

Example:

 $less = loader::helper('less','less_compiler');
$less->add('test.css','test.less','style.css');
echo $less->renderCache()

~~~~~~~~~~~~
OUTPUT
~~~~~~~~~~~~
<link rel="stylesheet" type="text/css" href="http://yoursite.com/files/css/test.css">
<link rel="stylesheet" type="text/css" href="http://yoursite.com/files/css/style.css">

  • Screenshots Screenshots
  • Demo Video
  • Demo Live Demo
  • Showcases Used On Sites
Approved by PRB

Our 30 Day Support Policy

  • Replies to tickets every few days.

Support Hosted

  • At External Website

Also Check Out