Movatterモバイル変換


[0]ホーム

URL:


TweetFollow @moonscript

lessphp

DocumentationSource on GitHub
Download
lessphp-0.4.0.tar.gz
orUsing Composer
New: lessphp 0.4.0, compiles Bootstrap 3, breaking changes, seeChangelog (August 9th 2013)

About

lessphp is a compiler forLESS written in PHP.

The entire compiler comes in a single includable class, but an additionalcommand 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 thelessphp documentation.

Follow the author on twitter for updates:@moonscript.

Demo

Use the live demo to test the compiler using your own code, or click through theexample buttons to see various parts of the language.

More Examples:variables,mixins,nested rules,namespaces,color functions,strings

Edit me ↴

CSS comes here, click compile to build.
·Go to fullscreen version

Download

stable:lessphp-0.4.0.tar.gz

source:http://github.com/leafo/lessphp


lessify:http://leafo.net/lessphp/lessify/

Composer

If you usePackagist for installing packages, then you can update yourcomposer.json like so:

{"require":{"leafo/lessphp":"0.4.0"}}

Quick Start

The typical flow oflessphp is to create a new instance oflessc,configure it how you like, then tell it to compile something using one built incompile methods.

Thecompile method compiles a string of LESS code to CSS.

<?phprequire"lessc.inc.php";$less=newlessc;echo$less->compile(".block { padding: 3 + 4px }");

ThecompileFile method reads and compiles a file. It will either return theresult or write it to the path specified by an optional second argument.

echo$less->compileFile("input.less");

ThecompileChecked method is likecompileFile, but it only compiles if the outputfile 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();}

Thelessc object can be configured through an assortment of instance methods.Some possible configuration options includechanging the outputformat,setting variables fromPHP, andcontrolling the preservation ofcomments, writingcustomfunctions and much more. It’s all described inthedocumentation.

Documentation

A complete reference manual can be found on thedocumentation page.

A list of changes is available on thechangelog page.

Plugins

Variouslessphp plugins exist for many frameworks:

If you've got one,email me it and I'll post ithere.

Issues

If you find something that isn’t working right feel free toleave acomment or post on theGitHub issues tracker. If you have anyinteresting ideas for additions to the language please do suggest them as well.You can alsoemail me if you want.

Comments

If you have aGitHub account, you can post bug reports on thegithub issuestracker.

generated bysitegen on Wed Jan 8 11:03:18 2014 · created byleaf corcoran · lessphp is licensed under GPL3/MIT

[8]ページ先頭

©2009-2025 Movatter.jp