more info
http://leafo.net/lessphp/
The entire compiler comes in a single includable class, but an additional command line interface to the compiler is included. It will run on PHP 5.1+. See the quick start for basic usage.
For an overview of the syntax take a look at the lessphp documentation.
source: http://github.com/leafo/lessphp
lessify: http://leafo.net/lessphp/lessify/
The
A list of changes is available on the changelog page.
http://leafo.net/lessphp/
About
lessphp is a compiler for LESS written in PHP.The entire compiler comes in a single includable class, but an additional command line interface to the compiler is included. It will run on PHP 5.1+. See the quick start for basic usage.
For an overview of the syntax take a look at the lessphp documentation.
Download
stable: lessphp-0.3.9.tar.gzsource: http://github.com/leafo/lessphp
lessify: http://leafo.net/lessphp/lessify/
Composer
If you use Packagist for installing packages, then you can update yourcomposer.json
like so:
{
"require": {
"leafo/lessphp": "0.3.9"
}
}
Quick Start
The typical flow of lessphp is to create a new instance oflessc
,
configure it how you like, then tell it to compile something using one built in
compile methods.The
compile
method compiles a string of LESS code to CSS.<?php
require "lessc.inc.php";
$less = new lessc;
echo $less->compile(".block { padding: 3 + 4px }");
The compileFile
method reads and compiles a file. It will either return the
result or write it to the path specified by an optional second argument.echo $less->compileFile("input.less");
The compileChecked
method is like compileFile
, but it only compiles if the output
file doesn’t exist or it’s older than the input file:$less->checkedCompile("input.less", "output.css");
If there any problem compiling your code, an exception is thrown with a helpful message:try {
$less->compile("invalid LESS } {");
} catch (exception $e) {
echo "fatal error: " . $e->getMessage();
}
The lessc
object can be configured through an assortment of instance methods.
Some possible configuration options include changing the output
format, setting variables from
PHP, and controlling the preservation of
comments, writing custom
functions and much more. It’s all described in the
documentation.Documentation
A complete reference manual can be found on the documentation page.A list of changes is available on the changelog page.
Plugins
Various lessphp plugins exist for many frameworks:- Symfony by ServerGrove
- WordPress by Oncle Tom
- Drupal by Corey Aufang
- CakePHP by sveggiani
- Magento by groupesoczed
No comments:
Post a Comment