public
Rubygem
Description: This project has been moved to automatthew/cassandra
Homepage: http://cassandra.rubyforge.org/
Clone URL: git://github.com/automatthew/casuistry.git
name age message
file Manifest Wed Jul 09 07:57:24 -0700 2008 clean up and better README [automatthew]
file README.rdoc Thu Sep 04 10:11:12 -0700 2008 rake tasks for site [automatthew]
file Rakefile Mon Sep 08 09:15:29 -0700 2008 site css and mab changes [automatthew]
file casuistry.gemspec Tue Jul 29 14:41:47 -0700 2008 bump gemspec [automatthew]
directory lib/ Mon Sep 08 09:15:29 -0700 2008 site css and mab changes [automatthew]
directory misc/ Sat Jul 19 13:41:02 -0700 2008 dan's code [automatthew]
directory site/ Mon Sep 08 09:15:29 -0700 2008 site css and mab changes [automatthew]
directory test/ Fri Jul 11 10:08:03 -0700 2008 toying with benchmark [automatthew]
README.rdoc

Casuistry, a.k.a Cssy

Cssy 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 Casuistry. This may go away in the future.

Usage

  css = Cssy.new
  css.process do

    div {

      # this is a property on div
      background :red

      selector('ul li') {
        color :green
      }

      p.ugly.truly {
        color :aqua
      }

      selector('.smurf').house {
        height '256px'
      }

      menu! {
        padding "10px"
      }

      # this is a property on div, again
      width '9934px'
    }

    gargamel do
      margin("0px")
    end

    selector('.outer.middle.inner') do
      top("34px")
    end
  end

  css.data    #=> array of arrays
  css.output  #=> string of css