Skip to content

zsoltlengyelit/LessCSS-for-Yii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 [email protected]: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');
}

About

Less CSS parser for Yii. Based on Leaf Corcoran's <[email protected]> lessc PHP parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages