less_css

Quick Profile

Alex Ooi Profile Picture
Hometown: Melbourne, Australia
Specializations: Java, Ruby on Rails
University: Software Engineering & Economics, Melbourne University
High School: VCE, Melbourne High School
Links:
 

Popular Articles

Wednesday, March 16, 2011

Recently I've integrated SASS, Blueprint and Compass into our RoR application, and the results have been surprisingly good. SASS itself provides a programmatic way of creating stylesheets (SASS allows you to use variables and function calls to consolidate CSS configurations), making it feel like you're actually programming rather than hacking styles together. Additionally, the Blueprint and Compass frameworks build upon SASS to provide a whole slew of helpful SASS functions (or "mixins" as they call it) which make doing a bunch of common tasks much simpler...

It truly does help improve the CSS coding experience ....

The Catch

Yes, there is a pretty big catch. You have to be using RoR and HAML as SASS seems to have dependencies on both (may or may not actually need HAML... i haven't bothered digging into that). And we all know how much i love RoR ...

So I need a way to achieve these same results in a non-RoR application.

Alternatives

So for a language agnostic solution the less css framework seems a more than adequate solution. It allows you to generate CSS either by:

  1. starting up a background process that watches for changes in your "less" files and regenerates CSS when changes are made in development, or
  2. dynamically processing the less files on the clients side using javascript

I'd hesitate to guess that you'd probably want to provide CSS files to the client and reduce javascript processing, so the first option is probably the way to go. Anyway, it seems that less css is an adequate and, most importantly, language agnostic solution to an annoying but rather underwhelming problem.

Disclaimer

I haven't had a chance yet to use less css in anger. Perhaps something unexpected will come out in the wash when I do. But I'm going to give it a shot the next time I have a spare moment to re-style this damn blog. Annoyingly I have to move house ... recently it seems that life seems to be getting in the way of coding ....

Comments ...

Holy Guacamole! Nobody has commented on this post yet! Why don't you make a name for yourself and be the first to do so ... Any comment whatsoever, as long as it is non-defamatory, will be welcome!

Add a Comment

*
*
You must answer the following simple maths question before your comment will be accepted.
*