grater 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  .sass-cache
2
+ pkg
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grater (0.1.0)
4
+ grater (0.1.1)
5
5
  sass (>= 3.2.0.alpha.261)
6
6
 
7
7
  GEM
@@ -1,10 +1,40 @@
1
1
  # Grater
2
2
 
3
- CSS grids as easy to use as a cheese grater.
3
+ CSS grids as easy to use as a cheese grater. Read the philosphy behind this super simple grid system [here](http://samsoff.es/posts/my-grid-system).
4
4
 
5
- Simply download [grater.css](https://github.com/samsoffes/grater/raw/master/grater.css) to get started. You can also install it as a gem if you are using Rails 3.1 or higher with the asset pipeline.
5
+ Simply download [grater.css](https://github.com/samsoffes/grater/raw/master/grater.css) to get started. You can also install it as a gem if you are using Rails 3.1 or higher with the asset pipeline (see below).
6
6
 
7
- ## Gem Installation
7
+ ## Usage
8
+
9
+ Simply structure some HTML like this:
10
+
11
+ ``` html
12
+ <div class="grater">
13
+ <div>
14
+ <p>This is on the left or on top when things get narrow.</p>
15
+ </div>
16
+ <div>
17
+ <p>This is on the right or on the bottom when things get narrow.</p>
18
+ </div>
19
+ </div>
20
+ ```
21
+
22
+ You can also use the reverse version:
23
+
24
+ ``` html
25
+ <div class="grater reverse">
26
+ <div>
27
+ <p>This is on the right or on top when things get narrow.</p>
28
+ </div>
29
+ <div>
30
+ <p>This is on the left or on the bottom when things get narrow.</p>
31
+ </div>
32
+ </div>
33
+ ```
34
+
35
+ `div.grater` is intended to be enclosed in a 640px or 300px container. You can optionally add `<div class="grater-container">` around it to get this functionality.
36
+
37
+ ## Asset Pipeline
8
38
 
9
39
  Add this line to your application's Gemfile:
10
40
 
@@ -16,10 +46,4 @@ And then execute:
16
46
 
17
47
  You may need to run `bundle update` since Rails comes with `sass-rails` which uses an older version of the Sass gem.
18
48
 
19
- You can also install it yourself with:
20
-
21
- $ gem install grater
22
-
23
- ## Usage
24
-
25
- Simply require `grater` like you would any other stylesheet using Sprockets.
49
+ Now, simply require `grater` like you would any other stylesheet using the Asset Pipeline.
@@ -1,8 +1,23 @@
1
- // Row
2
- section.grater {
1
+ $grater-large-container-width: 640px;
2
+ $grater-small-container-width: 300px;
3
+ $grater-column-width: 300px;
4
+ $grater-small-media-query: "all and (max-width: 660px)";
5
+
6
+ // Grater container
7
+ div.grater-container {
8
+ width: $grater-large-container-width;
9
+ margin: 0 auto;
10
+
11
+ @media #{$grater-small-media-query} {
12
+ width: $grater-small-container-width;
13
+ }
14
+ }
15
+
16
+ // Grater row
17
+ div.grater {
3
18
  // Columns
4
- > section {
5
- width: 300px;
19
+ > div {
20
+ width: $grater-column-width;
6
21
  margin: 0 0 2em;
7
22
 
8
23
  // First column
@@ -17,7 +32,7 @@ section.grater {
17
32
  }
18
33
 
19
34
  // When the `reverse` class is added, the columns are switch
20
- &.reverse > section {
35
+ &.reverse > div {
21
36
  &:first-child {
22
37
  float: right;
23
38
  }
@@ -41,10 +56,10 @@ section.grater {
41
56
  }
42
57
 
43
58
  // Responsive
44
- @media all and (max-width: 660px) {
59
+ @media #{$grater-small-media-query} {
45
60
  margin-bottom: 1em;
46
61
 
47
- > section {
62
+ > div {
48
63
  float: none !important; // Shut up. I know, I know
49
64
  margin: 0 auto 2em;
50
65
  }
@@ -1,3 +1,3 @@
1
1
  module Grater
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -76,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  segments:
78
78
  - 0
79
- hash: -617764701865611400
79
+ hash: -614044417912637991
80
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  segments:
87
87
  - 0
88
- hash: -617764701865611400
88
+ hash: -614044417912637991
89
89
  requirements: []
90
90
  rubyforge_project:
91
91
  rubygems_version: 1.8.23