Cissaby is CSS as ruby
January 4th, 2007
Check out my latest exploit, cissaby: a way to do CSS in ruby. Right now it isn’t quite finished, but I have figured out how I can make it work. So let’s say I have some CSS code like this:
div.article{ font-color: red; }
#errors, #header{ padding: 0px; }
#errors{ display: none; }
#header h2{ font-size: 2em; }
In cissaby I would have done it like this:
Cissaby::Builder.new{
div.article{ :"font-color" => "red" }
errors!/header!{ :padding => "0px" }
errors!{:display => "none"}
header!._.h2{ :"font-size" => "2em"}
}
Pretty uselessly awesome, huh? svn co http://ternimal.com/svn/cissaby/trunk/
3 Responses to “Cissaby is CSS as ruby”
Sorry, comments are closed for this article.
January 5th, 2007 at 01:26 PM
haha, that is pretty uselessly awesome indeed. Still, a good exercise I suppose, in uselessness.
January 5th, 2007 at 08:16 PM
If you convert underscores to dashes when you do the symbol -> CSS attribute conversion, this will work w/o quotes:
div.article{ :font_color => “red” }
January 22nd, 2007 at 01:23 PM
I’m doing something with code in the XMLBuilder trunk that was started by Scott Barron. I think it’s a great way to go.
http://topfunky.net/svn/plugins/styleaby/ http://nubyonrails.com/articles/2006/11/30/campin-in-oz-peepcode-test-first-development http://onestepback.org/index.cgi/Tech/Ruby/CssBuilder.red