The Dopefly Tech Blog
<< The Dopefly Tech Blog Main page
Post A Comment!
Less CSS - how CSS should have been!
posted under category: Standards on July 24, 2009 at 8:37 pm by MrNate
Has anyone else seen Less - Leaner CSS? Let me sum it up for you. It goes like this:
WHAT IS WRONG WITH THE W3C?
And you can take that one to the bank.
Seriously though, Less is an app built in Ruby that lets you write CSS in a reasonable
fashion, which it will compile into unreasonable standard CSS.
And what is reasonable for CSS? Where is it that the W3C has failed us so terribly? Less' feature set says it all: variables, mixins, nested rules and operations. You'll probably have to see it to believe it, but once you see it, you'll get it. Go ahead, visit the Less CSS
site, just the home page shows you everything.
My only problem with it is that it's Ruby. I don't have anything in particular against Ruby, I just don't want to install it or figure out how to use it to start coding with Less.
So where does that leave me?
1) Rewrite it in a language I like more
2) Suck it up, use Ruby
3) Recompile it with jRuby
Until then, I guess I will just be dreaming about it.
On Jul 27, 2009 at 5:22 AM Matt Williams (http://www.mattjanell.com/blog) said:
Why not just make your css file a cfm file and do something like so?
<cfset brand_color = "#4D926F">
On Feb 20, 2010 at 12:50 AM Roland Collins (rcollins whose domain rhymes with investedge.com) said:
@Matt - one word: caching.
If you put your CSS in a cfm file, you also need to ensure that said file properly communicates caching directives to the browser.
On the easy end of the solution spectrum, this might just mean adding a few cfheaders to your cfm/css page to communicate "not modified" directives. If your css is truly dynamic, well then you've just eliminated one of the biggest benefits of css, which is that it gets cached by the browser.
On Feb 20, 2010 at 11:51 AM Barney Boisvert (bboisvert, who breathes gmail.com) said:
All your problems have already been solved: http://www.barneyb.com/barneyblog/2009/09/08/lesscss-for-cfml-developers/
Post A Comment!
Well, maybe not all of them, but you can at least run it automatically from you CFML app.