{less} CSS for .Net

A while back I asked whether some enterprising-person-who-is-smarter-than-I would offer a version of the {less} CSS framework for .Net. Looks like they have, and they did it as I’d hoped: an HttpHandler mapped to the .less extension. So your .less files are compiled on the fly and served to the browser as plain ol’ CSS.

In brief, {less} is a syntax for CSS that allows for programmability and reusability. Define a color (or a whole set of CSS properties) in one place, and refer to them throughout. Makes global changes easy and makes your CSS much more concise. Heck, one wonders why CSS isn’t already like that.

And today Phil Haack offers another option: {less} compilation as a T4 template. The upside of that approach is that CSS files are created locally, right in Visual Studio. So you can deploy them to any server. It would help debugging, too.

Published December 4, 2009