Agile Web Development

Build it. Launch it. Love it.

less-rails

Plugin for Rails to automatically generate css templates out of less (http://www.lesscss.org) templates.

For this to work you need to have the less gem:

  sudo gem install less

This plugin provides you with some configuration options that can be set in either an initializer or an environment file. The options can be set like this:

  Less::Plugin.options[:template_location] = "#{RAILS_ROOT}/app/stylesheets"
  Less::Plugin.options[:css_location] = "#{RAILS_ROOT}/public/stylesheets"
  Less::Plugin.options[:update] = :when_changed
  Less::Plugin.options[:compress] = false

A quick description of the options:

 * :template_location is the location where the *.less files are to be found.
 * :css_location is the location where the generated *.css files are to be put.
 * :update defines when to update the *.css files, you have three options:
   * :never : never update the css files automatically.
   * :when_changed : update the css files when the corresponding less file is newer than the generated css file.
   * :always : update the css files on every request.
 * :compress : turns less's built-in compress functionality on or off.

The options as listed in the example code are the defaults that less-rails uses.

Vitals

Home http://github.com/karsthammer/less-rails
Repository git://github.com/karsthammer/less-rails
License BSD
Tags Tag_red
Rating (0 votes)
Owner Karst Hammer
Created 19 June 2009

Comments

Add a comment