kimcastle / laravel5-lessphp by kimcastle

Bringing lessphp into Laravel
95
0
2
Package Data
Maintainer Username: kimcastle
Maintainer Contact: kim@mixmedia.com (kimcastle)
Package Create Date: 2017-06-20
Package Last Update: 2017-06-20
Language: PHP
License: MIT
Last Refreshed: 2024-03-27 03:11:14
Package Statistics
Total Downloads: 95
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 1
Total Open Issues: 3

laravel5-lessphp

lessphp is a compiler for LESS by PHP

(1) First, pull in the package through Composer.

"require": {
    "kimcastle/laravel5-lessphp": "1.0.0"
}

(2) And then, if using Laravel 5, include the service provider within config/app.php.

'providers' => [
    "Kimcastle\Laravel5Less\LessServiceProvider::class"
];

In the aliases section, add:

'Less' => Kimcastle\Laravel5Less\Facades\Less::class

(3) Uage

Within your models or controllers, you can perform modification to the outputted CSS. Here are some examples:

use Kimcastle\Laravel5Less\Facades\Less;

class TestController extend Controller
{
     public function less()
     {
          Less::modifyVars(['@externalBgColor' => 'red'])->compile('less_test');
          
          Less::modifyVars(['@externalBgColor' => '#ff0001'])->url('less_test', true);
     }
}