Smarter And Better CSS For Ruby: LESS

LESS is a Ruby gem which compiles the LESS code to CSS & extends css by adding variables, mixins, operations and nested rules.

It uses the existing CSS syntax. So, it is very easy to convert current CSS files to LESS files & there is almost no learning curve.

LESS For Ruby

To help understand better, here is an example:

[sourcecode language=’css’]
@brand_color: #4D926F;
#header {
color: @brand_color;
h2 {
color: @brand_color;

LESS is well-documented & source can be found here.

  1. Reply Ron van de Graaf June 18, 2009 at 3:56 AM

    Nice… but it’s there is something better than this. Module HAML and SASS (in combination with Compass) for Ruby on Rails.

  2. Reply António Manuel Cardoso June 19, 2009 at 4:25 AM

    You don’t need this. You just use two or more class in the same div/tag; that one of that is for generic style

Leave a reply