2017 © Pedro Peláez
 

symfony-bundle less-elephant-bundle

Integrates LessElephant into Symfony2

image

cypresslab/less-elephant-bundle

Integrates LessElephant into Symfony2

  • Monday, March 4, 2013
  • by matteosister
  • Repository
  • 2 Watchers
  • 15 Stars
  • 5,357 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LessElephantBundle Travis build status

A Bundle to use the LessElephant library in a Symfony2 project., (*1)

This bundle scans your less projects on every request, and checks if they needs to be recompiled. It takes care of dependencies, so you can use less with @import without problems. You don't need javascript or manual excution of lessc anymore, (*2)

Installation, (*3)

Integrate bootstrap in Symfony2 and compile less on the fly, (*4)

Configuration

Add the configuration in your config file (for the dev environment), (*5)

app/config_dev.yml, (*6)

cypress_less_elephant:
    less_binary_path: "/usr/local/bin/lessc"
    less_projects:
        my-first-project:
            source_folder: %kernel.root_dir%/../src/Cypress/DemoBundle/Resources/public/bootstrap/less
            source_file: bootstrap.less
            destination_css: %kernel.root_dir%/../src/Cypress/DemoBundle/Resources/public/bootstrap/css/bootstrap.css
        another-project:
            .....
    force_compile: ~

less_binary_path (optional) is the path to your lessc binary. LessElephant try to find it with "which lessc". So, if you are on windows, you need this, (*7)

less_projects (at least 1) define an entry for each of your less projects. All three parameters are mandatory, (*8)

  • source_folder the folder where all your less files resides, (*9)

  • source_file the main less file. Usually this is a file that contains many @import directive, (*10)

  • destination_css the destination css. This file needs to be writable by web server user (for example on linux www-data), (*11)

force_compile (optional) default: false. If it is true, we force the compilation for each request., (*12)

Add the stylesheets to your templates, (*13)

assetic, (*14)

```html+jinja {% stylesheets filter="yui_css" "@CypressDemoBundle/Resources/public/bootstrap/css/bootstrap.css" %} {% endstylesheets %}, (*15)


*without assetic* ```html+jinja <link href="{{ asset('bundles/cypressdemo/bootstrap/css/bootstrap.css') }}" type="text/css" rel="stylesheet" />

Enjoy!, (*16)

How it works

This bundle register an event listener that, on every request, check if the projects defined in the config_dev.yml files are in "clean" state or needs recompile., (*17)

If the project do not need to be recompiled, it adds a really small overhead to symfony, just the time to check a bunch of files., (*18)

Read the LessElephant readme for other useful informations, (*19)

The Versions

04/03 2013

dev-master

9999999-dev https://github.com/matteosister/LessElephantBundle

Integrates LessElephant into Symfony2

  Sources   Download

GPL3

The Requires

 

css assets less

26/11 2012

dev-develop

dev-develop https://github.com/matteosister/LessElephantBundle

Integrates LessElephant into Symfony2

  Sources   Download

GPL3

The Requires

 

css assets less