Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rack middleware for serving LessCSS files compiled to CSS
Ruby
Tag: 0.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
README.markdown
Rakefile
rack-lesscss.gemspec

README.markdown

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.

Instalation

gem install rack-lesscss -s http://gemcutter.org

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", :source => "http://gemcutter.org"
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://sickill.net/

Something went wrong with that request. Please try again.