Skip to content

Latest commit

 

History

History
47 lines (42 loc) · 982 Bytes

README.md

File metadata and controls

47 lines (42 loc) · 982 Bytes

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');
}