Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Less Elephant Bundle Laravel Package

cypresslab/less-elephant-bundle

View on GitHub
Deep Wiki
Context7

LessElephantBundle Travis build status#

A Bundle to use the LessElephant library in a Symfony2 project.

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

Installation

Integrate bootstrap in Symfony2 and compile less on the fly

Configuration

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

app/config_dev.yml

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

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

  • source_folder the folder where all your less files resides

  • source_file the main less file. Usually this is a file that contains many @import directive

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

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

Add the stylesheets to your templates

assetic

{% stylesheets filter="yui_css"
    "@CypressDemoBundle/Resources/public/bootstrap/css/bootstrap.css" %}
    <link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}

without assetic

<link href="{{ asset('bundles/cypressdemo/bootstrap/css/bootstrap.css') }}" type="text/css" rel="stylesheet" />

Enjoy!

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.

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.

Read the LessElephant readme for other useful informations

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor