Less CSS parser for Yii. Based on Leaf Corcoran's <leafot@gmail.com> lessc PHP parser
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets/css
LessCss.php
README.md
lessc.inc.php

README.md

Installation

Clone this repo into your Yii application's protected/extensions dir

    cd /path/to/your/yii_app/protected/extensions
    mkdir lessCss
    cd lessCss
    git clone git@github.com:zsoltlengyelit/LessCSS-for-Yii.git
  

Usage

An exmample of use of LessCss:

    // app/themes/some_theme/assets/css/test.less
    
    // LESS
        .rounded-corners (@radius: 5px) {
            border-radius: @radius;
            -webkit-border-radius: @radius;
            -moz-border-radius: @radius;  
        }

        #header {
            .rounded-corners;
        }
        #footer {
            .rounded-corners(10px);
        }
  
  // SiteController.php file
  public function actionIndex()
    {
            Yii::import('ext.lessCss.LessCss');

            Yii::app()->clientScript
            ->registerCSSFile( // appends parsed less to HEAD tag
                LessCss::getCssUrl(Yii::app()->theme->basePath.'/assets/css/test.less')
                // will try cached parsing
            );
        $this->render('index');
    }