An open API service indexing awesome lists of open source software.

https://github.com/ku1ik/rack-lesscss

Rack middleware for serving LessCSS files compiled to CSS
https://github.com/ku1ik/rack-lesscss

Last synced: 2 months ago
JSON representation

Rack middleware for serving LessCSS files compiled to CSS

Awesome Lists containing this project

README

        

Rack::LessCss
=============

About
-----

Rack::LessCss, is a Rack middleware which converts .less files into .css files on the fly during request. It’s main purpose is to ease development stage when you change your .less files frequently. With rack-lesscss middleware enabled you don’t need to compile .less files by hand after every change. LessCSS compiler has an option to watch for changes in .less file and automatically recompiles it but you need to remember to run compiler in watch mode for every stylesheet every time you start development session. There are also at least two Rails plugins which nicely integrates LessCSS into the app but this middleware can be used with Rails as well as with other ruby web frameworks like Merb or Sinatra.

Installation
-----------

gem install rack-lesscss

Usage
-----

Enable in Merb:

config/dependencies.rb:

dependency "rack-lesscss"

config/rack.rb (before line with run Merb::Rack::Application.new):

use Rack::LessCss, :less_path => File.join(Merb.root, "public", "less")

Enable in Rails:

config/environment.rb:

config.gem "rack-lesscss"

config.middleware.use "Rack::LessCss", :less_path => File.join(RAILS_ROOT, "public", "less")

If you want this middleware to handle stylesheets under other request path you can change it like this:

use Rack::LessCss, :less_path => File.join(Merb.root, "public", "less"), :css_route => "/assets/css"

Contact & Information
---------------------

Marcin Kulik - http://ku1ik.com/

License
-------

This software is released under MIT license (see LICENSE file).