Closed Kolyunya closed 10 years ago
It is already supported via asset manager.
@Kolyunya client side less files are very slow as the less has to be parsed for every request in the browser so you should not do this. always compile less files on the server.
@samdark I am sorry, but I think you missunderstood the proposal which is to allow LESS files be registered via CClientScript like this.
Yii::app()->clientScript->registerCssFile('foo.less');
The above code should render a link to the less file with 'stylesheet/less' relation.
@samdark could you please elaborate what is actually supported by asset manager?
By asset manager I've meant Yii 2.0. For 1.1 it's not supported but as @cebe mentioned, it's a very bad practice to use JavaScript-based less compiler. It is extremely slow.
I would like to propose adding LESS support to the framework. LESS files sould be declared with 'stylesheet/less' relation. This feature may be easily implemented by modifying CHtml::cssFile like this (or something more performant) This will even allow registering LESS files through CClientScript like regular CSS files since it uses CHtml.