Yii 1.1: less-for-bootstrap

it's compile bootstrap less files
9 followers

This is my first extention , and it's not very complete.

It is inspired from less extention (that not working with last amazing extention version of bootstrap) and use lessphp v0.3.4-2 that is working with the twitter boortrap 2.03

the extention compile and also minify the css code !

Requirements

bootstrap

! this extention is developped and tested under yii 1.1.10

!! this compiler replace your bootstrap default files , for your first try you can save a copy of existing file just in case it not working for you !

Usage

extract file into protected/extentions/

Important : you have to declare the less extention in the preload config before bootstrap (it's required for buplishing assets of bootstrap) You also have to set

'debug' => true

if bootstrap config in order to publish assets .

Note that the compilation of less code is automatic every time ! for disabling it after all the less work is done , you need to comment (or remove) less entries from main.php config file

'preload'=>array(
        'log',
        'less',
        'bootstrap',
                    .
                    .
                    .
    ),

Add this entry in components :

'components'=>array(
          .
          .
          .
        'less'=>array(
            'class'=>'ext.less.components.LessCompiler',
            'paths'=>array(
                'protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less' => 'protected/extensions/bootstrap/assets/css/bootstrap.min.css',
                'protected/extensions/bootstrap/lib/bootstrap/less/responsive.less' => 'protected/extensions/bootstrap/assets/css/bootstrap-responsive.min.css',
            ),
        ),
          .
          .
          .
)

hope that will help you !

Resources

lessphp Cssmin

Total 2 comments

#8331 report it
Junior - df9 at 2012/05/26 02:18pm
please, fix the required file bug

Thanks Stageline for sharing the solution for required bug

+1 Stageline +1 yiiesss

Thank you guys, excellent extension combined with bootstrap!

:)

regards!

#8110 report it
Stageline at 2012/05/10 06:06pm
require file not found fix.
require Yii::app()->basepath.'/extensions/less/lib/lessphp/lessc.inc.php';

Leave a comment

Please to leave your comment.

Create extension
Downloads