zen-grids 1.0.alpha.2 → 1.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -19,7 +19,7 @@ column grid.
19
19
  // each side of each column.
20
20
 
21
21
  .container {
22
- @include zen-grid-container();
22
+ @include zen-grid-container;
23
23
  }
24
24
  .sidebar1 {
25
25
  @include zen-grid(1, 3); // 3 col. wide sidebar starting in the 1st column
@@ -66,6 +66,9 @@ $legacy-support-for-ie6: false !default;
66
66
  // the content box starts on. And set the $column-span to the number of columns
67
67
  // that the content box spans.
68
68
  //
69
+ // For content boxes that are floated right, the $column-position is counted
70
+ // from the right instead of from the left.
71
+ //
69
72
  @mixin zen-grid (
70
73
  $column-position,
71
74
  $column-span,
@@ -86,20 +89,16 @@ $legacy-support-for-ie6: false !default;
86
89
  }
87
90
  $rev: zen-direction-flip($dir);
88
91
 
89
- // Auto-apply the unit base mixin.
90
- @if $zen-auto-include-unit-base {
91
- @include zen-grid-unit-base($box-sizing);
92
- }
93
-
94
92
  float: $dir;
95
93
  width: $column-span * $unit-width;
96
94
  margin: {
97
95
  #{$dir}: ($column-position - 1) * $unit-width;
98
96
  #{$rev}: (1 - $column-position - $column-span) * $unit-width;
99
97
  }
100
- padding: {
101
- left: $gutter-width / 2;
102
- right: $gutter-width / 2;
98
+
99
+ // Auto-apply the unit base mixin.
100
+ @if $zen-auto-include-unit-base {
101
+ @include zen-grid-unit-base($gutter-width, $box-sizing);
103
102
  }
104
103
  }
105
104
 
@@ -107,11 +106,21 @@ $legacy-support-for-ie6: false !default;
107
106
  // Apply this mixin to each content box in the layout to prevent overflowing
108
107
  // content from breaking the layout.
109
108
  //
110
- // The mixin has the following optional parameters:
109
+ // The mixin has the following optional parameters, but its better to use the
110
+ // $zen-gutter-width and $zen-box-sizing variables instead:
111
+ // - $gutter-width: Half of this value is applied as padding to the left and
112
+ // right sides of the element.
111
113
  // - $box-sizing: The type of CSS3 box model each box should use. Can be set to
112
114
  // content-box or border-box. Defaults to content-box, but border-box is way
113
115
  // cooler. IE 6 and 7 don't support border-box.
114
- @mixin zen-grid-unit-base ($box-sizing: $zen-box-sizing) {
116
+ @mixin zen-grid-unit-base (
117
+ $gutter-width: $zen-gutter-width,
118
+ $box-sizing: $zen-box-sizing
119
+ ) {
120
+ padding: {
121
+ left: $gutter-width / 2;
122
+ right: $gutter-width / 2;
123
+ }
115
124
  // Specify the border-box properties.
116
125
  @if $box-sizing == border-box {
117
126
  -moz-box-sizing: border-box;
@@ -127,16 +136,14 @@ $legacy-support-for-ie6: false !default;
127
136
  overflow: visible;
128
137
  word-wrap: break-word; // A very nice CSS3 property.
129
138
 
130
- @if $legacy-support-for-ie6 {
131
- @if $box-sizing == content-box {
132
- .ie6 & {
133
- display: inline; // display inline or double your floated margin! [1]
134
- overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
135
- overflow-y: visible;
136
- }
137
- }
138
- @else {
139
- @warn "IE6 legacy support is on, but $box-sizing is set to #{$box-sizing}.";
139
+ @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) and $box-sizing == border-box {
140
+ @warn "IE legacy support is on, but $box-sizing is set to #{$box-sizing}.";
141
+ }
142
+ @else if $legacy-support-for-ie6 and $box-sizing == content-box {
143
+ .ie6 & {
144
+ display: inline; // display inline or double your floated margin! [1]
145
+ overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
146
+ overflow-y: visible;
140
147
  }
141
148
  }
142
149
  }
@@ -155,6 +162,41 @@ $legacy-support-for-ie6: false !default;
155
162
  clear: $dir;
156
163
  }
157
164
 
165
+ //
166
+ // Apply this to an element to help align it to the grid. Set the $column-span
167
+ // to the number of columns that the content box spans. Set the $column-count to
168
+ // the number of columns that the parent element spans.
169
+ //
170
+ @mixin zen-grid-width (
171
+ $column-span,
172
+ $column-count: $zen-column-count,
173
+ $alpha-margin: false,
174
+ $omega-margin: false,
175
+ $gutter-width: $zen-gutter-width,
176
+ $grid-width: $zen-grid-width,
177
+ $box-sizing: $zen-box-sizing
178
+ ) {
179
+
180
+ $dir: $zen-float-direction;
181
+ @if $zen-reverse-all-floats {
182
+ $dir: zen-direction-flip($dir);
183
+ }
184
+ $rev: zen-direction-flip($dir);
185
+ @if $alpha-margin {
186
+ margin-#{$dir}: -1 * zen-half-gutter($gutter-width);
187
+ }
188
+ @if $omega-margin {
189
+ margin-#{$rev}: -1 * zen-half-gutter($gutter-width);
190
+ }
191
+
192
+ // Calculate the unit width.
193
+ $unit-width: $grid-width / $column-count;
194
+ width: $column-span * $unit-width;
195
+
196
+ // Auto-apply the unit base mixin.
197
+ @include zen-grid-unit-base($gutter-width, $box-sizing);
198
+ }
199
+
158
200
 
159
201
  //
160
202
  // Helper functions for the Zen mixins.
@@ -167,3 +209,8 @@ $legacy-support-for-ie6: false !default;
167
209
  }
168
210
  @return left;
169
211
  }
212
+
213
+ // Returns a half gutter width.
214
+ @function zen-half-gutter($gutter-width: $zen-gutter-width) {
215
+ @return $gutter-width / 2;
216
+ }
@@ -72,8 +72,8 @@ $zen-gutter-width: 20px;
72
72
  @include zen-grid(1, 2);
73
73
  }
74
74
  #aside1 {
75
- @include zen-grid(1, 1);
76
75
  @include zen-clear(); // Clear left-floated elements (#content)
76
+ @include zen-grid(1, 1);
77
77
  }
78
78
  #aside2 {
79
79
  @include zen-grid(2, 1);
@@ -87,10 +87,10 @@ $zen-gutter-width: 20px;
87
87
  @include zen-grid(1, 2);
88
88
  }
89
89
  #aside1 {
90
- @include zen-grid(1, 1, right);
90
+ @include zen-grid(1, 1, right); // Position from the right
91
91
  }
92
92
  #aside2 {
93
- @include zen-clear(left); // Clear right-floated elements (#content)
93
+ @include zen-clear(); // Clear left-floated elements (#content)
94
94
  @include zen-grid(1, 2);
95
95
  }
96
96
  }
@@ -102,7 +102,7 @@ $zen-gutter-width: 20px;
102
102
  @include zen-grid(1, 2);
103
103
  }
104
104
  #aside1 {
105
- @include zen-grid(1, 1, right);
105
+ @include zen-grid(1, 1, right); // Position from the right
106
106
  }
107
107
  #aside2 {
108
108
  @include zen-clear(right); // Clear right-floated elements (#aside1)
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.alpha.2'
13
- s.date = '2012-01-12'
12
+ s.version = '1.0.alpha.3'
13
+ s.date = '2012-01-15'
14
14
 
15
15
  s.authors = ['John Albin Wilkins']
16
16
  s.email = 'virtually.johnalbin@gmail.com'
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zen-grids
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ hash: -3702664262
5
+ prerelease: 4
5
6
  segments:
6
7
  - 1
7
8
  - 0
8
9
  - alpha
9
- - 2
10
- version: 1.0.alpha.2
10
+ - 3
11
+ version: 1.0.alpha.3
11
12
  platform: ruby
12
13
  authors:
13
14
  - John Albin Wilkins
@@ -15,16 +16,17 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2012-01-12 00:00:00 +08:00
19
- default_executable:
19
+ date: 2012-01-15 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: sass
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 5
28
30
  segments:
29
31
  - 3
30
32
  - 1
@@ -52,7 +54,6 @@ files:
52
54
  - templates/project/layout.scss
53
55
  - templates/project/styles.scss
54
56
  - zen-grids.gemspec
55
- has_rdoc: true
56
57
  homepage: http://zengrids.com
57
58
  licenses: []
58
59
 
@@ -62,16 +63,20 @@ rdoc_options: []
62
63
  require_paths:
63
64
  - lib
64
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
65
67
  requirements:
66
68
  - - ">="
67
69
  - !ruby/object:Gem::Version
70
+ hash: 3
68
71
  segments:
69
72
  - 0
70
73
  version: "0"
71
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
72
76
  requirements:
73
77
  - - ">"
74
78
  - !ruby/object:Gem::Version
79
+ hash: 25
75
80
  segments:
76
81
  - 1
77
82
  - 3
@@ -79,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
84
  version: 1.3.1
80
85
  requirements: []
81
86
 
82
- rubyforge_project: 1.0.alpha.2
83
- rubygems_version: 1.3.6
87
+ rubyforge_project: 1.0.alpha.3
88
+ rubygems_version: 1.8.15
84
89
  signing_key:
85
90
  specification_version: 3
86
91
  summary: A Compass plugin for Zen Grids, a fluid responsive grid system