<commit_before># ILess - PHP port of Less.js

![ILess](logo.png)

## What is Less?

Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques 
that allow you to make CSS that is more maintainable, themable and extendable. 

For more info about the language see the official website: <http://lesscss.org>

## What is This?

ILess is a **PHP port** of the official LESS processor written in Javascript. Current version of ILess is compatible with less.js `2.5.x.`

## Build Status

[![Build Status](https://travis-ci.org/mishal/iless.png?branch=master)](https://travis-ci.org/mishal/iless)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/mishal/iless/badges/quality-score.png?s=513af3953e6974968feac9c445db32489c62c35f)](https://scrutinizer-ci.com/g/mishal/iless/)

## Getting Started

To use ILess in your project you can:

  - Install it using Composer ([more info on Packagist](https://packagist.org/packages/mishal/iless))
  - [Download the latest release](https://github.com/mishal/iless/archive/master.zip)
  - Clone the repository: `git clone git://github.com/mishal/iless.git`

## Requirements

To run ILess you need `PHP >= 5.4.0`

## Feature Highlights

 * Allows to register **custom file importers** (from filesystem, database, ...)
 * Allows to setup **import directories** so search imports for
 * Allows to define **custom LESS functions** with PHP callbacks, supports context aware dynamic functions
 * Generates **source maps** (useful for debugging the generated CSS)
 * Generates debugging information with SASS compatible information and/or simple comments
 * Supports output filters
 * Allows caching of the precompiled files and the generated CSS
 * Is **unit tested** using PHPUnit
 * Compiled CSS is 100% equal to CSS compiled with less.js (exception is javascript, which cannot be evaluated using php)
 * Provides command line utility    
 * Has developer friendly exception messages with location of the error and file excerpt (output is colorized when used by command line)
 * Has well documented API

## Usage

### Basic usage

    <?php

    use ILess\Parser;
    use ILess\FunctionRegistry;
    use ILess\Node\ColorNode;
    use ILess\Node\DimensionNode;

    // setup autoloading
    // 1) when installed with composer
    require 'vendor/autoload.php';

    // 2) when installed manually
    // require_once 'lib/ILess/Autoloader.php';
    // ILess\Autoloader::register();

    $parser = new Parser();
    
    // parses the file
    $parser->parseFile('screen.less');

    // parse string<commit_msg>Added link to docs<commit_after># ILess - PHP port of Less.js

![ILess](logo.png)

## What is Less?

Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques 
that allow you to make CSS that is more maintainable, themable and extendable. 

For more info about the language see the official website: <http://lesscss.org>

## What is This?

ILess is a **PHP port** of the official LESS processor written in Javascript. Current version of ILess is compatible with less.js `2.5.x.`

## Build Status

[![Build Status](https://travis-ci.org/mishal/iless.png?branch=master)](https://travis-ci.org/mishal/iless)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/mishal/iless/badges/quality-score.png?s=513af3953e6974968feac9c445db32489c62c35f)](https://scrutinizer-ci.com/g/mishal/iless/)

## Getting Started

To use ILess in your project you can:

  - Install it using Composer ([more info on Packagist](https://packagist.org/packages/mishal/iless))
  - [Download the latest release](https://github.com/mishal/iless/archive/master.zip)
  - Clone the repository: `git clone git://github.com/mishal/iless.git`

## Requirements

To run ILess you need `PHP >= 5.4.0`

## Feature Highlights

 * Allows to register **custom file importers** (from filesystem, database, ...)
 * Allows to setup **import directories** so search imports for
 * Allows to define **custom LESS functions** with PHP callbacks, supports context aware dynamic functions
 * Generates **source maps** (useful for debugging the generated CSS)
 * Generates debugging information with SASS compatible information and/or simple comments
 * Supports output filters
 * Allows caching of the precompiled files and the generated CSS
 * Is **unit tested** using PHPUnit
 * Compiled CSS is 100% equal to CSS compiled with less.js (exception is javascript, which cannot be evaluated using php)
 * Provides command line utility    
 * Has developer friendly exception messages with location of the error and file excerpt (output is colorized when used by command line)
 * Has well documented API, see [the docs](http://doc-iless.rhcloud.com)

## Usage

### Basic usage

    <?php

    use ILess\Parser;
    use ILess\FunctionRegistry;
    use ILess\Node\ColorNode;
    use ILess\Node\DimensionNode;

    // setup autoloading
    // 1) when installed with composer
    require 'vendor/autoload.php';

    // 2) when installed manually
    // require_once 'lib/ILess/Autoloader.php';
    // ILess\Autoloader::register();

    $parser = new Parser();
    
    // parses the file
    $parser->parseFile('screen.less');

    // parse string
{'fraction_non_alphanumeric': 0.10309859154929578, 'fraction_numerical': 0.013896713615023475, 'mean_word_length': 3.977570093457944, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705354', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1536, 'n_words': 569}