Extend CSS With Variables, Mixins, Operations and Nested Rules Using LESS

Tuesday, 09 February 2010

LESS:

LESS extends CSS with: variables, mixins, operations and nested rules.

Best of all, LESS uses existing CSS syntax. This means you can rename your current.css files to .less and they'll just work.

LESS defines its own extension to CSS syntax which then gets compiled into standard CSS. It's a really great idea. And there's a great companion app for Mac OS X called less.app:

This app makes working with LESS a snap by turning it into a graphical interface.

Basically, this standalone app allows you to compile your .less files into CSS with a click of a button. The really nice thing about it though is that it can be set up to monitor changes to your LESS files and then recompile the associated CSS files automatically.

You can also use LESS directly from within Ruby on Rails using the More plugin (which compiles the .less files into .css files automatically).

Update: Konstantin Kudryashov pointed me to a version for Symfony as well. And while we're at it, here's a plugin for Django. It's a little more generic but LESS is one of the compilers it supports.