Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rack middleware for serving LessCSS files compiled to CSS

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.

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).

Something went wrong with that request. Please try again.