/ruprint

Rails helpers for layout with blueprint css.

Primary LanguageRubyMIT LicenseMIT

Ruprint

Ruprint is a simple Rails helper for creating grid layouts with Blueprint CSS.

Prerequisites

This doesn’t include Blueprint, so you need to acquire and generate the actual stylesheets yourself.

Example of use

Add the stylesheet link tags to your layout using the helper:

blueprint_link_tags

or if your stylesheets are anywhere other than /stylesheets you can specify the directory like so:

blueprint_link_tags(:css_dir => "/foo/bar")

Then simple usage within a template is like so:

grid do |grid|
  grid.add_row do |row|
    row.add_column do |column|
      column.width = 5
      column.html  = "<p>Some single line content</p>"
    end
  end
  grid.add_column do |column|
    column.width = 10
    column.html do
      <p>Some multi line content</p>
    end
  end
end

Other info

Check the docs for the builder classes GridBuilder, RowBuilder and ColumnBuilder for what other attributes you can activate. In particular check the class accessors which are used to do things like set div ids, extra classes and activate Blueprint’s box and column classes.

Blueprint

The Blueprint CSS homepage is at www.blueprintcss.org and can be found on Github at github.com/joshuaclayton/blueprint-css/tree/master.

Copyright © 2009 Jon Gilbraith, released under the MIT license