public
Description: Generate CSS using Ruby with Markaby/Builder style syntax
Homepage: http://cassandra.rubyforge.org
Clone URL: git://github.com/automatthew/cassandra.git
name age message
file Manifest Tue Sep 30 11:10:02 -0700 2008 update gemspec [automatthew]
file README.rdoc Mon Sep 08 10:16:00 -0700 2008 update readme to look like site [automatthew]
file Rakefile Tue Sep 30 11:13:57 -0700 2008 bump gemspec version to 0.2.4 [automatthew]
file cassandra.gemspec Tue Sep 30 11:13:57 -0700 2008 bump gemspec version to 0.2.4 [automatthew]
directory lib/ Tue Sep 30 11:10:02 -0700 2008 update gemspec [automatthew]
directory misc/ Tue Sep 16 07:41:08 -0700 2008 docs and cleanup [automatthew]
directory site/ Tue Sep 30 10:17:47 -0700 2008 process now takes an assigns hash [automatthew]
directory test/ Tue Sep 30 11:10:02 -0700 2008 update gemspec [automatthew]
README.rdoc

Cassandra, a.k.a Cssy

Cassandra is a CSS companion to Markaby. You declare selectors using methods named after the type selectors (i.e. tags) or after the class and id selectors of your choice, which are handled by method_missing. As in Markaby, id selectors are distinguished from class selectors by the "!" at the end of the method name. You can chain class/id selectors onto type selectors and each other.

Because in CSS you don’t have to begin with a type selector, starting a selector chain with a class/id selector is currently allowed in Cassandra. This may go away in the future.

Usage

  @css = Cssy.new
  @css.process do

    body { background_color "#F8F7F1"}
    div.content! {
      width "700px"; margin "25px auto"

      a {
        color "#212F54";
        text_decoration :none
        font_weight :bold
      }

      ul.links! { list_style "url(flower.png)"  }
    }

  end

  @css.data    #=> array of arrays
  @css.to_s