Coder Social home page Coder Social logo

lessy's Introduction

Lessy (Laravel4 Package)

Confide Poster

ProjectStatus

Lessy is a simple and lean LESS compiler for Laravel.

In summary, Lessy will compile the files contained in app/less to the public/asset/css directory respecting any existing directory structure. For example: if you have app/less/admin/panel.less lessy will compile it to public/asset/css/admin/panel.css when the application receives a request. You can change the input and output directories trough configuration (see below).

The automatic compilation occurs only if the output file doesn't exist or it's an older version than the input file.

Important: Note that the automatic compilation does not occur when the application is in 'production' environment. So make sure to change the application environment to 'local' or something that is not 'production' if you need Lessy to automagically compile your LESS files.

Features

Current:

  • Automagically compiles LESS files when not in production
  • Respects directory structure when compiling
  • Compile LESS files trough artisan lessy:compile

Quick start

Required setup

In the require key of composer.json file add the following

"zizaco/lessy": "dev-master"

Run the Composer update comand

$ composer update

In your config/app.php add 'Zizaco\Lessy\LessyServiceProvider' to the end of the $providers array

'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Zizaco\Lessy\LessyServiceProvider',

),

You are ready to go! Your application will now compile LESS files when needed. Remember that this does not occur in production environment.

Configuration (Optional)

By default, Lessy will consider the directory app/less as the input and public/assets/css for the output. But if you wish to change these values โ€‹โ€‹simply publish the package config files:

$ php artisan config:publish zizaco/lessy

and define the origin and destination keys in config/packages/zizaco/lessy/config.php. Example:

// config/packages/zizaco/lessy/config.php

// Paths should be relative to app folder.
'origin'        => 'mylessfiles',
'destination'   => '../public/mycss',

The automatic compilation does not occur when the application is in 'production' environment. So make sure to change the application environment to 'local' or something that is not 'production' if you need Lessy to automagically compile your LESS files.

Console usage

If for some reason you need to force the compilation of LESS files (ex: in production environment), its possible through the command:

$ php artisan lessy:compile

License

Lessy is a free software distributed under the terms of the MIT license

Aditional information

Any questions, feel free to contact me.

lessy's People

Contributors

boydcl avatar zizaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lessy's Issues

Stop Lessy from compiling every files

Hi !
I have put this in my config file :
'origin' => '../public/assets',
'destination' => '../public/assets',
Because I have a folder for Front and one for Admin and need both Less files to be compliles. But the issue is that I have somes less files that only contains mixins and Lessy compile them to css. Is there a way to "exclude" a folder or files ? As a result I have several empty css files...
Thanks for this great packages ๐Ÿ‘
Mushr00m

How can I create source maps?

From what I read about it, I need to add -sass-debug-info but I am not sure.

See less/less.js#1038

Or maybe --source-map --source-map-basepath?

node_modules/less/bin/lessc --source-map --source-map-basepath="`pwd`"/web --source-map-rootpath=/ --strict-imports web/assets/site/css/bootstrap/bootstrap-full.less web/assets/site/css/bootstrap/bootstrap-full.css

See less/less.js#1050

Mainly I need to define custom parameters for lessc

main file option

HI!! Great package, I like the idea.

Can you add an option to only compile one file?. In my case I work with a main file.
Also can you add an option to compile with compression?

Thks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.