zen-grids 1.0.beta.1 → 1.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -9,13 +9,13 @@ Zen Grids system can be applied to an infinite number of layouts.
9
9
  USAGE
10
10
  -----
11
11
 
12
- A simple example: a content column with a sidebar on each side, aligned to a 12
13
- column grid.
12
+ Here's a simple example: a content column with a sidebar on each side, aligned
13
+ to a 12 column grid.
14
14
 
15
15
  @import "zen";
16
16
 
17
17
  $zen-column-count: 12; // Set the total number of columns in the grid.
18
- $zen-gutter-width: 30px; // Set the gutter size. A half-gutter is used on
18
+ $zen-gutter-width: 40px; // Set the gutter size. A half-gutter is used on
19
19
  // each side of each column.
20
20
 
21
21
  .container {
@@ -34,23 +34,38 @@ column grid.
34
34
  Within the .container element, the .sidebar1, .sidebar2 and .content elements
35
35
  can be in any order.
36
36
 
37
+ Zen Grids has built-in support for the Box-sizing Polyfill which adds
38
+ "box-sizing: border-box" support to IE7 and earlier.
39
+
40
+ - Download the polyfill at https://github.com/Schepp/box-sizing-polyfill
41
+ - Place the boxsizing.htc file in your website.
42
+ - Set Zen Grids' $box-sizing-polyfill-path variable to the absolute path to the
43
+ boxsizing.htc file on your website. For example:
44
+ $box-sizing-polyfill-path: "/scripts/polyfills/boxsizing.htc";
45
+
37
46
 
38
47
  INSTALLATION
39
48
  ------------
40
49
 
41
50
  Zen grids is distributed as a Ruby Gem. On your computer, simply run:
42
51
 
43
- sudo gem install zen-grids --pre
52
+ sudo gem install zen-grids
44
53
 
45
- Then to add it to an existing project, edit the project's configuration file,
46
- config.rb, and add this line:
54
+ If you are using Compass (and you should!) then you can add it to an existing
55
+ project by editing the project's configuration file, config.rb, and adding this
56
+ line:
47
57
 
48
58
  require 'zen-grids'
49
59
 
50
- And then, from the project's root directory, run:
60
+ For Rails projects, from the project's root directory, run:
51
61
 
52
62
  compass install zen-grids
53
63
 
64
+ You can then start using Zen Grids in your Sass files. Just add this line to one
65
+ of your .sass or .scss files and start creating!
66
+
67
+ @import "zen";
68
+
54
69
 
55
70
  REQUIREMENTS
56
71
  ------------
@@ -10,31 +10,35 @@ $zen-column-count: 12 !default;
10
10
  // side of a grid column.
11
11
  $zen-gutter-width: 20px !default;
12
12
 
13
+ // You can generate more efficient CSS if you manually apply the
14
+ // zen-grid-item-base mixin to all grid items from within a single ruleset.
15
+ $zen-auto-include-item-base: true !default;
16
+ $zen-auto-include-flow-item-base: true !default;
17
+
13
18
  // Specify the width of the entire grid. Defaults to 100% for a fluid responsive
14
19
  // design, but you can change this to a pixel value if you need a fixed grid.
15
20
  $zen-grid-width: 100% !default;
16
21
 
17
- // Specify the default floating direction for zen's mixins.
18
- $zen-float-direction: left !default;
19
-
20
22
  // Specify the CSS3 box-sizing method. The default, "border-box", is compatible
21
23
  // with all modern browsers, including IE 8 and later. Use "content-box" for
22
24
  // wider compatibility (Note: you'll also need to set $legacy-support-for-ie7
23
25
  // and $legacy-support-for-ie6 to true.)
24
26
  $zen-box-sizing: border-box !default;
25
27
 
26
- // This is a helper variable for RTL layouts.
27
- $zen-reverse-all-floats: false !default;
28
-
29
- // You can generate more efficient CSS if you manually apply the
30
- // zen-grid-item-base mixin to all grid items from within a single ruleset.
31
- $zen-auto-include-item-base: true !default;
32
- $zen-auto-include-html-item-base: true !default;
33
-
34
28
  // Turn off IE6/7 support since we're defaulting to box-sizing: border-box.
35
29
  $legacy-support-for-ie7: false !default;
36
30
  $legacy-support-for-ie6: false !default;
37
31
 
32
+ // The box-sizing polyfill for IE6/7 requires an absolute path to the
33
+ // boxsizing.htc file. See https://github.com/Schepp/box-sizing-polyfill
34
+ $box-sizing-polyfill-path: "" !default;
35
+
36
+ // Specify the default floating direction for zen's mixins.
37
+ $zen-float-direction: left !default;
38
+
39
+ // This is a helper variable for RTL layouts.
40
+ $zen-reverse-all-floats: false !default;
41
+
38
42
 
39
43
  //
40
44
  // Zen Grids requires the clearfix mixin.
@@ -139,14 +143,24 @@ $legacy-support-for-ie6: false !default;
139
143
  overflow: visible;
140
144
  word-wrap: break-word; // A very nice CSS3 property.
141
145
 
142
- @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) and $box-sizing == border-box {
143
- @warn "IE legacy support is on, but $box-sizing is set to #{$box-sizing}.";
146
+ @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) and $box-sizing == border-box and $box-sizing-polyfill-path == "" {
147
+ @warn "IE legacy support is on, but $box-sizing is set to #{$box-sizing} and the $box-sizing-polyfill-path is empty.";
144
148
  }
145
- @else if $legacy-support-for-ie6 and $box-sizing == content-box {
146
- .ie6 & {
147
- display: inline; // display inline or double your floated margin! [1]
148
- overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
149
- overflow-y: visible;
149
+ @else {
150
+ @if $legacy-support-for-ie7 and $box-sizing-polyfill-path {
151
+ .ie7 & {
152
+ behavior: url($box-sizing-polyfill-path);
153
+ }
154
+ }
155
+ @if $legacy-support-for-ie6 {
156
+ .ie6 & {
157
+ display: inline; // display inline or double your floated margin! [1]
158
+ overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
159
+ overflow-y: visible;
160
+ @if $box-sizing-polyfill-path {
161
+ behavior: url($box-sizing-polyfill-path);
162
+ }
163
+ }
150
164
  }
151
165
  }
152
166
  }
@@ -172,32 +186,45 @@ $legacy-support-for-ie6: false !default;
172
186
  // HTML element should span. Set the $column-count to the number of columns that
173
187
  // the parent element spans.
174
188
  //
175
- // Unlike the zen-grid-item() mixin, this mixin does not float the HTML item. To
176
- // help position the item to align flush with the left edge of a containing grid
177
- // item, you can set the $alpha-margin to true. To help position the item to
178
- // align to align flush with the right edge of a containing grid item, you can
179
- // set the $omega-margin to true.
189
+ // Unlike the zen-grid-item() mixin, this mixin does not float the HTML item; it
190
+ // also does not have a half-gutter on each side. By default, it has no gutter
191
+ // in the "alpha position" (the left side) and a full gutter in the "omega
192
+ // position" (the right side.) You can turn on or off the alpha and omega
193
+ // gutters by setting the $alpha-gutter and $omega-gutter parameters to true or
194
+ // false.
195
+ //
196
+ // Note: when the $flow-direction is set to right (for RTL languages), the alpha
197
+ // position is on the right and the omega position is on the left.
180
198
  //
181
- @mixin zen-grid-html-item (
199
+ @mixin zen-grid-flow-item (
182
200
  $column-span,
183
- $column-count: $zen-column-count,
184
- $alpha-margin: false,
185
- $omega-margin: false,
201
+ $column-count,
202
+ $alpha-gutter: false,
203
+ $omega-gutter: true,
186
204
  $gutter-width: $zen-gutter-width,
187
205
  $grid-width: $zen-grid-width,
188
206
  $box-sizing: $zen-box-sizing,
189
- $auto-include-html-item-base: $zen-auto-include-html-item-base
207
+ $auto-include-flow-item-base: $zen-auto-include-flow-item-base,
208
+ $flow-direction: $zen-float-direction
190
209
  ) {
191
210
 
192
- $dir: $zen-float-direction;
211
+ $dir: $flow-direction;
193
212
  @if $zen-reverse-all-floats {
194
213
  $dir: zen-direction-flip($dir);
195
214
  }
196
215
  $rev: zen-direction-flip($dir);
197
- @if $alpha-margin {
216
+
217
+ // Ensure the HTML item either has a full gutter or no gutter on each side.
218
+ @if $alpha-gutter {
219
+ margin-#{dir}: zen-half-gutter($gutter-width);
220
+ }
221
+ @else {
198
222
  margin-#{$dir}: -1 * zen-half-gutter($gutter-width);
199
223
  }
200
- @if $omega-margin {
224
+ @if $omega-gutter {
225
+ margin-#{$rev}: zen-half-gutter($gutter-width);
226
+ }
227
+ @else {
201
228
  margin-#{$rev}: -1 * zen-half-gutter($gutter-width);
202
229
  }
203
230
 
@@ -206,7 +233,7 @@ $legacy-support-for-ie6: false !default;
206
233
  width: $column-span * $unit-width;
207
234
 
208
235
  // Auto-apply the unit base mixin.
209
- @if $auto-include-html-item-base {
236
+ @if $auto-include-flow-item-base {
210
237
  @include zen-grid-item-base($gutter-width, $box-sizing);
211
238
  }
212
239
  }
@@ -221,7 +248,10 @@ $legacy-support-for-ie6: false !default;
221
248
  @if $dir == left {
222
249
  @return right;
223
250
  }
224
- @return left;
251
+ @else if $dir == right {
252
+ @return left;
253
+ }
254
+ @return both;
225
255
  }
226
256
 
227
257
  // Returns a half gutter width.
@@ -22,6 +22,7 @@
22
22
  <h1>Main content</h1>
23
23
  <p>Source order: 1</p>
24
24
  </header>
25
+ <aside>‘There’s no such thing!’</aside>
25
26
  <p>Alice did not quite know what to say to this: so she helped herself to some tea and bread-and-butter, and then turned to the Dormouse, and repeated her question. ‘Why did they live at the bottom of a well?’</p>
26
27
  <p>The Dormouse again took a minute or two to think about it, and then said, ‘It was a treacle-well.’</p>
27
28
  <p>‘There’s no such thing!’ Alice was beginning very angrily, but the Hatter and the March Hare went ‘Sh! sh!’ and the Dormouse sulkily remarked, ‘If you can’t be civil, you’d better finish the story for yourself.’</p>
@@ -49,6 +49,18 @@ $zen-gutter-width: 20px;
49
49
  @include zen-grid-container();
50
50
  }
51
51
 
52
+ #content aside {
53
+ font-weight: bold;
54
+ font-style: italic;
55
+ font-size: 1.2em;
56
+ @include zen-grid-flow-item(1, 3);
57
+ float: left;
58
+ margin: {
59
+ top: (1em/1.2);
60
+ bottom: (1em/1.2);
61
+ }
62
+ }
63
+
52
64
  //
53
65
  // Horizontal navigation bar
54
66
  @media all and (min-width: 480px) {
@@ -59,7 +71,7 @@ $zen-gutter-width: 20px;
59
71
  padding-top: $navbar-height;
60
72
  }
61
73
  #main-menu {
62
- @include zen-grid(1, 1);
74
+ @include zen-grid-item(1, 1);
63
75
  margin-top: -$navbar-height;
64
76
  height: $navbar-height;
65
77
  }
@@ -69,14 +81,14 @@ $zen-gutter-width: 20px;
69
81
  $zen-column-count: 2;
70
82
 
71
83
  #content {
72
- @include zen-grid(1, 2);
84
+ @include zen-grid-item(1, 2);
73
85
  }
74
86
  #aside1 {
75
87
  @include zen-clear(); // Clear left-floated elements (#content)
76
- @include zen-grid(1, 1);
88
+ @include zen-grid-item(1, 1);
77
89
  }
78
90
  #aside2 {
79
- @include zen-grid(2, 1);
91
+ @include zen-grid-item(2, 1);
80
92
  }
81
93
  }
82
94
 
@@ -84,14 +96,14 @@ $zen-gutter-width: 20px;
84
96
  $zen-column-count: 3;
85
97
 
86
98
  #content {
87
- @include zen-grid(1, 2);
99
+ @include zen-grid-item(1, 2);
88
100
  }
89
101
  #aside1 {
90
- @include zen-grid(1, 1, right); // Position from the right
102
+ @include zen-grid-item(1, 1, right); // Position from the right
91
103
  }
92
104
  #aside2 {
93
105
  @include zen-clear(); // Clear left-floated elements (#content)
94
- @include zen-grid(1, 2);
106
+ @include zen-grid-item(1, 2);
95
107
  }
96
108
  }
97
109
 
@@ -99,14 +111,14 @@ $zen-gutter-width: 20px;
99
111
  $zen-column-count: 3;
100
112
 
101
113
  #content {
102
- @include zen-grid(1, 2);
114
+ @include zen-grid-item(1, 2);
103
115
  }
104
116
  #aside1 {
105
- @include zen-grid(1, 1, right); // Position from the right
117
+ @include zen-grid-item(1, 1, right); // Position from the right
106
118
  }
107
119
  #aside2 {
108
120
  @include zen-clear(right); // Clear right-floated elements (#aside1)
109
- @include zen-grid(1, 1, right);
121
+ @include zen-grid-item(1, 1, right);
110
122
  }
111
123
  }
112
124
 
@@ -114,12 +126,12 @@ $zen-gutter-width: 20px;
114
126
  $zen-column-count: 5;
115
127
 
116
128
  #content {
117
- @include zen-grid(2, 3);
129
+ @include zen-grid-item(2, 3);
118
130
  }
119
131
  #aside1 {
120
- @include zen-grid(1, 1);
132
+ @include zen-grid-item(1, 1);
121
133
  }
122
134
  #aside2 {
123
- @include zen-grid(5, 1);
135
+ @include zen-grid-item(5, 1);
124
136
  }
125
137
  }
data/zen-grids.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
9
9
  s.homepage = 'http://zengrids.com'
10
10
  s.rubyforge_project =
11
11
 
12
- s.version = '1.0.beta.1'
13
- s.date = '2012-01-20'
12
+ s.version = '1.0.beta.2'
13
+ s.date = '2012-02-06'
14
14
 
15
15
  s.authors = ['John Albin Wilkins']
16
16
  s.email = 'virtually.johnalbin@gmail.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zen-grids
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196289
4
+ hash: 62196295
5
5
  prerelease: 4
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - beta
10
- - 1
11
- version: 1.0.beta.1
10
+ - 2
11
+ version: 1.0.beta.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - John Albin Wilkins
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-01-20 00:00:00 Z
19
+ date: 2012-02-06 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: sass
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: 1.3.1
85
85
  requirements: []
86
86
 
87
- rubyforge_project: 1.0.beta.1
87
+ rubyforge_project: 1.0.beta.2
88
88
  rubygems_version: 1.8.15
89
89
  signing_key:
90
90
  specification_version: 3