Grader

This gem provides a simple way to rapid prototyping of layouts in web apps in modern browsers.

Grader was extracted from out of radiant.fm.

Getting Help

Installation

Requires Rails 3.1 and higher.

gem 'grader'

Also you will need Bourbon installed.

Getting Started

At first configure Bourbon as it explained in official github page.

Then import grader after bourbon in application.css.scss. For example:

@import "bourbon";
@import "grader";

By default grader's grid have 12 columns with 60px height per column and 20px gutter. You can override it by creating variables.css.scss and import it to your application.css.scss file.

For example to create 16 columns grid with 30px height per column and 10px gutter:

$gw-column: 30px;
$gw-gutter: 10px;
$gw-count: 16;

Usage

Simple row with 3 columns:

<section class="container">
  <div class="row">
    <div class="span-3">
      Left column.
    </div>
    <div class="span-6">
      Middle column.
    </div>
    <div class="close-3">
      Right column without left padding.
    </div>
  </div>
</secton>

Offsetting columns:

<section class="container">
  <div class="row">
    <div class="span-4">
      Left column.
    </div>
    <div class="span-4 prefix-4">
      Right column with margin from left for 4 columns.
    </div>
  </div>
  <div class="row">
    <div class="span-4 suffix-4">
      Left column with margin from right for 4 columns..
    </div>
    <div class="span-4">
      Right column 
    </div>
  </div>
</secton>   

Nesting columns:

<section class="container">
  <div class="row">
    <div class="span-12">
      Level 1 of column
      <div class="row">
        <div class="span-6">Level 2</div>
        <div class="span-6">Level 2</div>
      </div>
    </div>
  </div>
</section>

License

Copyright (c) 2012 radiant.fm

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.