PHPackages                             crisu83/yii-less - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. crisu83/yii-less

ActiveYii-extension[Framework](/categories/framework)

crisu83/yii-less
================

LESS compilers for the Yii PHP framework.

v2.0.2(12y ago)91.6k12[1 issues](https://github.com/Crisu83/yii-less/issues)BSD-3-ClausePHP

Since Apr 3Pushed 12y ago4 watchersCompare

[ Source](https://github.com/Crisu83/yii-less)[ Packagist](https://packagist.org/packages/crisu83/yii-less)[ RSS](/packages/crisu83-yii-less/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

yii-less
========

[](#yii-less)

Less is an extension for the [Yii PHP framework](http://www.yiiframework.com) that allows developers to compile [LESS](http://wwwcss.org) files into CSS using the native JavaScript compiler. LESS can be compiled both client-side using less.js and server-side using lessc. Less comes with two compilers, a client compiler that uses less.js and a server compiler that uses lessc.

### Requirements

[](#requirements)

- [Node.js](http://nodejs.org/download/) and [less](http://lesscss.org/#usage) to use the server-side compiler

### Credits

[](#credits)

Thanks to my friend Sam Stenvall (negge) for providing me with his version of the server-side compiler.

Usage
-----

[](#usage)

### Setup

[](#setup)

Download the latest version, unzip the extension under ***protected/extensions/less*** and add the desired component (client or server) to your application configuration. Below you can find example configurations for both compilers.

Once the component is loaded all specified LESS files will be compiled (as long as they have changed or forceCompile is enabled) which makes it a good candidate for pre-loading. It is up to you to register the generated CSS files in your layout.

#### Client-side

[](#client-side)

```
return array(
  'components'=>array(
    .....
    'less'=>array(
      'class'=>'ext.less.components.LessClientCompiler',
      'files'=>array(
        'less/styles.less'=>'css/styles.css',
      ),
    ),
  ),
);
```

#### Server-side

[](#server-side)

In order to compile your LESS server-side you need to download and install [Node.js](http://nodejs.org/download/). When you have installed Node.js use npm (Node Packaged Modules) to install the less module.

```
return array(
  'components'=>array(
    'less'=>array(
      'class'=>'ext.less.components.LessServerCompiler',
      'files'=>array(
        'less/styles.less'=>'css/styles.css',
      ),
      'nodePath'=>'path/to/node.exe',
      'compilerPath'=>'path/to/lessc',
    ),
  ),
);
```

### Configuration

[](#configuration)

Below you can find a list of the available configurations (with default values) for each compiler.

#### Client-side

[](#client-side-1)

```
'less'=>array(
  'class'=>'ext.less.components.LessClientCompiler',
  'files'=>array( // files to compile (relative from your base path)
    'less/styles.less'=>'css/styles.css',
  ),
  'env'=>'production', // compiler environment, either production or development
  'async'=>false, // load imports asynchronous?
  'fileAsync'=>false, // load imports asynchronous when in a page under a file protocol
  'poll'=>1000, // when in watch mode, time in ms between polls
  'dumpLineNumbers'=>'mediaQuery', // enables debugging, set to comments, mediaQuery or all
  'watch'=>true, // enable watch mode?
),
```

#### Server-side

[](#server-side-1)

```
'less'=>array(
  'class'=>'ext.less.components.LessServerCompiler',
  'files'=>array( // files to compile (relative from your base path)
    'less/styles.less'=>'css/styles.css',
  ),
  'basePath'=>'path/to/webroot', // base path, defaults to webroot
  'nodePath'=>'path/to/node.exe', // absolute path to nodejs executable
  'compilerPath'=>'path/to/lessc', // absolute path to lessc
  'strictImports'=>false, // force evaluation of imports?
  'compression'=>false, // enable compression, either whitespace or yui
  'optimizationLevel'=>false, // parser optimization level, set to 0, 1 or 2
  'forceCompile'=>false, // compile files on each request?
),
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~34 days

Total

6

Last Release

4649d ago

Major Versions

v1.1.2 → v2.0.02013-06-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3becb3323ceb956c661f3e6ef4312dcd00ec4ba03d1bba5fcef793f5c4286d?d=identicon)[crisu83](/maintainers/crisu83)

---

Top Contributors

[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (23 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (7 commits)")[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (6 commits)")[![igorsantos07](https://avatars.githubusercontent.com/u/532299?v=4)](https://github.com/igorsantos07 "igorsantos07 (3 commits)")[![ddinchev](https://avatars.githubusercontent.com/u/1397692?v=4)](https://github.com/ddinchev "ddinchev (1 commits)")[![sandro1111](https://avatars.githubusercontent.com/u/3843611?v=4)](https://github.com/sandro1111 "sandro1111 (1 commits)")

---

Tags

less

### Embed Badge

![Health badge](/badges/crisu83-yii-less/health.svg)

```
[![Health](https://phpackages.com/badges/crisu83-yii-less/health.svg)](https://phpackages.com/packages/crisu83-yii-less)
```

###  Alternatives

[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)[nette/bootstrap

🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.

68535.8M592](/packages/nette-bootstrap)[widmogrod/zf2-assetic-module

Zend Framework 2 module that provides complete integration of Assetic library

144348.5k8](/packages/widmogrod-zf2-assetic-module)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
