laravelless/lessphp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravelless/lessphp

Composer 安装命令:

composer require laravelless/lessphp

包简介

Lessphp leafo for Laravel 5

README 文档

README

LESS with your Laravel. Using Leafo.php

Features

  • Can modify LESS variables on-the-fly
  • Can parse custom CSS/LESS and append it to the resulting file
  • Caching support

Installation

You need composer to install.

$ composer require laravelless/lessphp

Add Provider,Facade to config/app.php

    'providers' => [
        ...,
        Laravelless\Lessphp\LessphpServiceProvider::class,
    ];
    /**********/
    'aliases' => [
        ...,
        'Lessphp'   => Laravelless\Lessphp\LessphpFacade::class,
    ];

After that you need publish vendor.

$ php artisan vendor:publish

Now you must have config/Lessphp.php so you can edit that where is your LESS path and your file must be excute to CSS

    return array(
        'css_path'          => base_path('css'),
        'less_path'         => base_path('less'),
        'cache_extension'   => '.cache',
        'formatter'         => "compressed",
    );

Functions

For execute to css is simple :

    $filename = 'style.less';
    $less = \Lessphp::compile($filename);

NOTE : Lessphp return url("css/$filename.css") Will be fixed soon to dynamical path.

For execute cached less => css

    $filename = 'style.less';
    $less = \Lessphp::cacheCompile($filename);

NOTE : You can set output filename for cacheCompile as second parameter.

    $less = \Lessphp::cacheCompile($filename,'style-min');

You can set variables before compile like this :

    $data = [
                'myBorderRadius'=>'5px',
            ];
    $less = \Lessphp::setVariables($data)->compile($filename);

License

HRAFIEE

IT's Free , SO Enjoy your free World

统计信息

  • 总下载量: 90
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固