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

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -22,13 +22,13 @@ to a 12 column grid.
22
22
  @include zen-grid-container;
23
23
  }
24
24
  .sidebar1 {
25
- @include zen-grid(3, 1); // 3 col. wide sidebar starting in the 1st column
25
+ @include zen-grid-item(3, 1); // Span 3 columns starting in 1st column
26
26
  }
27
27
  .content {
28
- @include zen-grid(6, 4); // 6 col. wide element starting in the 4th column
28
+ @include zen-grid-item(6, 4); // Span 6 columns starting in 4th column
29
29
  }
30
30
  .sidebar2 {
31
- @include zen-grid(3, 10); // 3 col. wide sidebar starting in the 10th column
31
+ @include zen-grid-item(3, 10); // Span 3 columns starting in 10th column
32
32
  }
33
33
 
34
34
  Within the .container element, the .sidebar1, .sidebar2 and .content elements
@@ -1,3 +1,3 @@
1
- // Import the partial for Zen Grids, but not for Zen Columns.
1
+ // Import the partial for Zen Grids.
2
2
 
3
3
  @import "zen/grids";
@@ -33,16 +33,6 @@ $zen-box-sizing: border-box !default;
33
33
  $legacy-support-for-ie7: false !default;
34
34
  $legacy-support-for-ie6: false !default;
35
35
 
36
- // Specify the method to add IE legacy support; can be hack or class. Setting
37
- // this to class will result in generated CSS rules using html/body classes
38
- // specified in $default-legacy-ie*-class variables, like those used in HTML5
39
- // Boilerplate.
40
- $default-legacy-ie-approach: hack !default;
41
-
42
- // The html/body classes to use when $default-legacy-ie-approach equals class.
43
- $default-legacy-ie6-class: lt-ie7;
44
- $default-legacy-ie7-class: lt-ie8;
45
-
46
36
  // Specify the default floating direction for zen's mixins.
47
37
  $zen-float-direction: left !default;
48
38
 
@@ -154,11 +144,10 @@ $zen-reverse-all-floats: false !default;
154
144
  @if $reverse-all-flows {
155
145
  $dir: zen-direction-flip($dir);
156
146
  }
157
- $rev: zen-direction-flip($dir);
158
147
 
159
148
  padding: {
160
- left: zen-half-gutter($gutter-width, $dir);
161
- right: zen-half-gutter($gutter-width, $rev);
149
+ left: zen-half-gutter($gutter-width, left, $dir);
150
+ right: zen-half-gutter($gutter-width, right, $dir);
162
151
  }
163
152
  // Specify the border-box properties.
164
153
  @if $box-sizing == border-box {
@@ -175,38 +164,20 @@ $zen-reverse-all-floats: false !default;
175
164
  overflow: visible;
176
165
  word-wrap: break-word; // A very nice CSS3 property.
177
166
 
178
- @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) and $box-sizing == border-box and $box-sizing-polyfill-path == "" {
179
- @warn "IE legacy support is on, but $box-sizing is set to #{$box-sizing} and the $box-sizing-polyfill-path is empty.";
180
- }
181
- @else {
182
- @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) {
183
- @if $box-sizing-polyfill-path {
184
- @if $default-legacy-ie-approach == hack {
185
- *behavior: url($box-sizing-polyfill-path);
186
- }
187
- @else {
188
- #{$default-legacy-ie7-class} & {
189
- behavior: url($box-sizing-polyfill-path);
190
- }
191
- }
192
- }
193
- @if $legacy-support-for-ie6 {
194
- @if $default-legacy-ie-approach == hack {
195
- _display: inline; // display inline or double your floated margin! [1]
196
- _overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
197
- _overflow-y: visible;
198
- }
199
- @else {
200
- #{$default-legacy-ie6-class} & {
201
- display: inline; // display inline or double your floated margin! [1]
202
- overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
203
- overflow-y: visible;
204
- }
205
- }
206
- // 1. http://www.positioniseverything.net/explorer/doubled-margin.html
207
- // 2. http://browservulsel.blogspot.com/2005/04/ie-overflow-auto-scrollbar-overlap.html
208
- // 3. http://www.howtocreate.co.uk/wrongWithIE/?chapter=overflow%3Avisible%3B
209
- }
167
+ @if ($legacy-support-for-ie6 or $legacy-support-for-ie7) {
168
+ @if $box-sizing == border-box and $box-sizing-polyfill-path == "" {
169
+ @warn "IE legacy support is on, but $box-sizing is set to #{$box-sizing} and the $box-sizing-polyfill-path is empty.";
170
+ }
171
+ @if $box-sizing-polyfill-path != "" {
172
+ *behavior: url($box-sizing-polyfill-path);
173
+ }
174
+ @if $legacy-support-for-ie6 {
175
+ _display: inline; // display inline or double your floated margin! [1]
176
+ _overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
177
+ _overflow-y: visible;
178
+ // 1. http://www.positioniseverything.net/explorer/doubled-margin.html
179
+ // 2. http://browservulsel.blogspot.com/2005/04/ie-overflow-auto-scrollbar-overlap.html
180
+ // 3. http://www.howtocreate.co.uk/wrongWithIE/?chapter=overflow%3Avisible%3B
210
181
  }
211
182
  }
212
183
  }
@@ -7,9 +7,7 @@ stylesheet 'styles.scss', :media => 'all'
7
7
  html 'example.html'
8
8
 
9
9
  help %Q{
10
- The Zen Grids system is an easy-to-use responsive grid system. It's immune to
11
- browser rounding errors and its source order is mostly independent from display
12
- order. To learn more, visit:
10
+ Zen Grids includes a fluid responsive grid system with an intuitive, flexible layout mechanism that leverages the natural source order of your content. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including adaptive and fixed-width layouts. To learn more, visit:
13
11
 
14
12
  http://zengrids.com
15
13
  }
@@ -20,6 +18,5 @@ how to use the system at:
20
18
 
21
19
  http://zengrids.com
22
20
 
23
- It's easy! And (bonus!) you'll find pre-made responsive layouts you can
24
- customize and start using on your website today.
21
+ It's easy!
25
22
  }
@@ -0,0 +1,16 @@
1
+ UNIT TESTS FOR ZEN GRIDS
2
+ ------------------------
3
+
4
+ To run the unit tests for Zen Grids:
5
+
6
+ 1. Create a "tests" Compass project using the unit-tests pattern:
7
+
8
+ compass create tests -r zen-grids --using=zen-grids/unit-tests
9
+
10
+ 2. From inside the "tests" project, compare the compiled stylesheets to the
11
+ previous unit test results in the test-results directory:
12
+
13
+ diff -r test-results/ stylesheets/
14
+
15
+ If the unit tests were successful, the above command should report no
16
+ differences.
@@ -0,0 +1,31 @@
1
+ description "Unit tests for the Zen Grids system."
2
+
3
+ stylesheet 'sass/function-zen-direction-flip.scss', :media => 'all', :to => 'function-zen-direction-flip.scss'
4
+ stylesheet 'sass/function-zen-half-gutter.scss', :media => 'all', :to => 'function-zen-half-gutter.scss'
5
+ stylesheet 'sass/zen-clear.scss', :media => 'all', :to => 'zen-clear.scss'
6
+ stylesheet 'sass/zen-grid-container.scss', :media => 'all', :to => 'zen-grid-container.scss'
7
+ stylesheet 'sass/zen-grid-flow-item.scss', :media => 'all', :to => 'zen-grid-flow-item.scss'
8
+ stylesheet 'sass/zen-grid-item-base.scss', :media => 'all', :to => 'zen-grid-item-base.scss'
9
+ stylesheet 'sass/zen-grid-item.scss', :media => 'all', :to => 'zen-grid-item.scss'
10
+ stylesheet 'sass/zen-nested-container.scss', :media => 'all', :to => 'zen-nested-container.scss'
11
+
12
+ file 'test-results/function-zen-direction-flip.css'
13
+ file 'test-results/function-zen-half-gutter.css'
14
+ file 'test-results/zen-clear.css'
15
+ file 'test-results/zen-grid-container.css'
16
+ file 'test-results/zen-grid-flow-item.css'
17
+ file 'test-results/zen-grid-item-base.css'
18
+ file 'test-results/zen-grid-item.css'
19
+ file 'test-results/zen-nested-container.css'
20
+
21
+ file 'README.txt'
22
+
23
+ help %Q{
24
+ To run the unit tests, simply run "compass compile" and compare the generated
25
+ CSS to those in the results directory.
26
+ diff -r results css
27
+ }
28
+
29
+ welcome_message %Q{
30
+ You rock! The unit tests for the Zen Grids system are now installed.
31
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @file
3
+ * Test zen-direction-flip()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-direction-flip {
9
+ /* Test zen-direction-flip(left) */
10
+ float: zen-direction-flip(left);
11
+
12
+ /* Test zen-direction-flip(right) */
13
+ float: zen-direction-flip(right);
14
+
15
+ /* Test zen-direction-flip(both) */
16
+ float: zen-direction-flip(both);
17
+
18
+ /* Test zen-direction-flip(none) */
19
+ float: zen-direction-flip(none);
20
+
21
+ /* Test zen-direction-flip(invalid) */
22
+ float: zen-direction-flip(invalid);
23
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file
3
+ * Test zen-half-gutter()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-half-gutter {
9
+ /* Test zen-half-gutter() with default $zen-gutter-width: 20px */
10
+ padding-left: zen-half-gutter();
11
+
12
+ /* Test zen-half-gutter() with $zen-gutter-width: 30px */
13
+ $zen-gutter-width: 30px;
14
+ padding-left: zen-half-gutter();
15
+
16
+ /* Test zen-half-gutter(10em) */
17
+ padding-left: zen-half-gutter(10em);
18
+
19
+ /* Test zen-half-gutter(11em) */
20
+ padding-left: zen-half-gutter(11em);
21
+
22
+ /* Test zen-half-gutter(10px) */
23
+ padding-left: zen-half-gutter(10px);
24
+
25
+ /* Test zen-half-gutter(11px) */
26
+ padding-left: zen-half-gutter(11px);
27
+
28
+ /* Test zen-half-gutter(11px, right) */
29
+ padding-left: zen-half-gutter(11px, right);
30
+
31
+ /* Test zen-half-gutter(11px) with $zen-float-direction: right */
32
+ $zen-float-direction: right;
33
+ padding-left: zen-half-gutter(11px);
34
+
35
+ /* Test zen-half-gutter(11px, left) with $zen-float-direction: right */
36
+ padding-left: zen-half-gutter(11px, left);
37
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file
3
+ * Test zen-clear()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-clear {
9
+ /* Test zen-clear() */
10
+ @include zen-clear();
11
+
12
+ /* Test zen-clear() with $zen-float-direction: right */
13
+ $zen-float-direction: right;
14
+ @include zen-clear();
15
+ $zen-float-direction: left;
16
+
17
+ /* Test zen-clear(left) */
18
+ @include zen-clear(left);
19
+
20
+ /* Test zen-clear(left, $reverse-all-floats: TRUE) */
21
+ @include zen-clear(left, $reverse-all-floats: TRUE);
22
+
23
+ /* Test zen-clear(left) with: $zen-reverse-all-floats: TRUE; */
24
+ $zen-reverse-all-floats: TRUE;
25
+ @include zen-clear(left);
26
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-container()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-grid-container {
9
+ /* Test zen-grid-container() */
10
+ @include zen-grid-container();
11
+ }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-flow-item()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-grid-flow-item {
9
+ /* Test zen-grid-flow-item(1) without setting $column-count */
10
+ @include zen-grid-flow-item(1);
11
+
12
+ /* Test zen-grid-flow-item(1, 4) with 12 column grid and 20px gutter */
13
+ @include zen-grid-flow-item(1, 4);
14
+
15
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter */
16
+ $zen-gutter-width: 15px;
17
+ @include zen-grid-flow-item(1, 4);
18
+ $zen-gutter-width: 20px;
19
+
20
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $zen-float-direction: right */
21
+ $zen-gutter-width: 15px;
22
+ $zen-float-direction: right;
23
+ @include zen-grid-flow-item(1, 4);
24
+ $zen-gutter-width: 20px;
25
+ $zen-float-direction: left;
26
+
27
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $alpha-gutter: true */
28
+ $zen-gutter-width: 15px;
29
+ @include zen-grid-flow-item(1, 4, $alpha-gutter: true);
30
+ $zen-gutter-width: 20px;
31
+
32
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $omega-gutter: false */
33
+ $zen-gutter-width: 15px;
34
+ @include zen-grid-flow-item(1, 4, $omega-gutter: false);
35
+ $zen-gutter-width: 20px;
36
+
37
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter, $zen-float-direction: right and $alpha-gutter: true */
38
+ $zen-gutter-width: 15px;
39
+ $zen-float-direction: right;
40
+ @include zen-grid-flow-item(1, 4, $alpha-gutter: true);
41
+ $zen-gutter-width: 20px;
42
+ $zen-float-direction: left;
43
+
44
+ /* Test zen-grid-flow-item(1, 4) with $zen-box-sizing: content-box and 10% gutter */
45
+ $zen-gutter-width: 10%;
46
+ $zen-box-sizing: content-box;
47
+ @include zen-grid-flow-item(1, 4);
48
+ $zen-gutter-width: 20px;
49
+ $zen-box-sizing: border-box;
50
+
51
+ /* Test zen-grid-flow-item(1, 4) with $zen-auto-include-flow-item-base: false */
52
+ $zen-auto-include-flow-item-base: false;
53
+ @include zen-grid-flow-item(1, 4);
54
+ }
55
+
56
+
57
+ @mixin zen-grid-flow-item (
58
+ $column-span,
59
+ $parent-column-count: false,
60
+ $alpha-gutter: false,
61
+ $omega-gutter: true,
62
+ $flow-direction: $zen-float-direction,
63
+ $column-count: $zen-column-count,
64
+ $gutter-width: $zen-gutter-width,
65
+ $grid-width: $zen-grid-width,
66
+ $box-sizing: $zen-box-sizing,
67
+ $reverse-all-flows: $zen-reverse-all-floats,
68
+ $auto-include-flow-item-base: $zen-auto-include-flow-item-base
69
+ ) {
70
+
71
+ $columns: $column-count;
72
+ @if unit($grid-width) == "%" {
73
+ @if $parent-column-count == false {
74
+ @warn "For responsive layouts with a percentage-based grid width, you must set the $column-count to the number of columns that the parent element spans.";
75
+ }
76
+ @else {
77
+ $columns: $parent-column-count;
78
+ }
79
+ }
80
+
81
+ $dir: $flow-direction;
82
+ @if $reverse-all-flows {
83
+ $dir: zen-direction-flip($dir);
84
+ }
85
+ $rev: zen-direction-flip($dir);
86
+
87
+ // Ensure the HTML item either has a full gutter or no gutter on each side.
88
+ @if $alpha-gutter {
89
+ margin-#{$dir}: zen-half-gutter($gutter-width, $rev);
90
+ }
91
+ @else {
92
+ margin-#{$dir}: -(zen-half-gutter($gutter-width, $dir));
93
+ }
94
+ @if $omega-gutter {
95
+ margin-#{$rev}: zen-half-gutter($gutter-width, $dir);
96
+ }
97
+ @else {
98
+ margin-#{$rev}: -(zen-half-gutter($gutter-width, $rev));
99
+ }
100
+
101
+ // Calculate the unit width.
102
+ $unit-width: $grid-width / $columns;
103
+ $width: $column-span * $unit-width;
104
+ @if $box-sizing == content-box {
105
+ @if not comparable($width, $gutter-width) {
106
+ $units-gutter: unit($gutter-width);
107
+ $units-grid: unit($grid-width);
108
+ @warn "The layout cannot be calculated correctly; when using box-sizing: content-box, the units of the gutter (#{$units-gutter} did not match the units of the grid width (#{$units-grid}).";
109
+ }
110
+ $width: $width - $gutter-width;
111
+ }
112
+ width: $width;
113
+
114
+ // Auto-apply the unit base mixin.
115
+ @if $auto-include-flow-item-base {
116
+ @include zen-grid-item-base($gutter-width, $box-sizing);
117
+ }
118
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-item-base()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-grid-item-base {
9
+ /* Test zen-grid-item-base() */
10
+ @include zen-grid-item-base();
11
+
12
+ /* Test zen-grid-item-base() with $zen-box-sizing: content-box */
13
+ $zen-box-sizing: content-box;
14
+ @include zen-grid-item-base();
15
+ $zen-box-sizing: border-box;
16
+
17
+ /* Test zen-grid-item-base() with $legacy-support-for-ie7: true */
18
+ $legacy-support-for-ie7: true;
19
+ @include zen-grid-item-base();
20
+ $legacy-support-for-ie7: false;
21
+
22
+ /* Test zen-grid-item-base() with $box-sizing-polyfill-path: "/boxsizing.htc" and $legacy-support-for-ie7: true */
23
+ $box-sizing-polyfill-path: "/boxsizing.htc";
24
+ $legacy-support-for-ie7: true;
25
+ @include zen-grid-item-base();
26
+ $box-sizing-polyfill-path: "";
27
+ $legacy-support-for-ie7: false;
28
+
29
+ /* Test zen-grid-item-base() with $box-sizing-polyfill-path: "/boxsizing.htc" and $legacy-support-for-ie6: true */
30
+ $box-sizing-polyfill-path: "/boxsizing.htc";
31
+ $legacy-support-for-ie6: true;
32
+ @include zen-grid-item-base();
33
+ $box-sizing-polyfill-path: "";
34
+ $legacy-support-for-ie6: false;
35
+
36
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px */
37
+ $zen-gutter-width: 15px;
38
+ @include zen-grid-item-base();
39
+ $zen-gutter-width: 20px;
40
+
41
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px and $zen-float-direction: right */
42
+ $zen-gutter-width: 15px;
43
+ $zen-float-direction: right;
44
+ @include zen-grid-item-base();
45
+ $zen-gutter-width: 20px;
46
+ $zen-float-direction: left;
47
+
48
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px and $zen-reverse-all-floats: true */
49
+ $zen-gutter-width: 15px;
50
+ $zen-reverse-all-floats: true;
51
+ @include zen-grid-item-base();
52
+ $zen-gutter-width: 20px;
53
+ $zen-reverse-all-floats: false;
54
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-item()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-grid-item {
9
+ /* Test zen-grid-item(6, 4) with 12 column grid and 20px gutter */
10
+ @include zen-grid-item(6, 4);
11
+
12
+ /* Test zen-grid-item(3, 3) with box-sizing: content-box, 5 column grid and 10% gutter */
13
+ $zen-column-count: 5;
14
+ $zen-gutter-width: 10%;
15
+ $zen-box-sizing: content-box;
16
+ @include zen-grid-item(3, 3);
17
+ $zen-box-sizing: border-box;
18
+
19
+ /* Turn off $zen-auto-include-item-base */
20
+ $zen-auto-include-item-base: false;
21
+
22
+ /* Test zen-grid-item(3, 3) with 5 column grid and 40px gutter */
23
+ $zen-column-count: 5;
24
+ $zen-gutter-width: 40px;
25
+ @include zen-grid-item(3, 3);
26
+
27
+ /* Test zen-grid-item(3, 3, right) with 5 column grid and 40px gutter */
28
+ $zen-column-count: 5;
29
+ $zen-gutter-width: 40px;
30
+ @include zen-grid-item(3, 3, right);
31
+
32
+ /* Test zen-grid-item(3, 3) with 5 column grid and 40px gutter and $zen-reverse-all-floats */
33
+ $zen-column-count: 5;
34
+ $zen-gutter-width: 40px;
35
+ $zen-reverse-all-floats: true;
36
+ @include zen-grid-item(3, 3);
37
+ $zen-reverse-all-floats: false;
38
+
39
+ /* Test zen-grid-item(3, 3, right) with 5 column grid and 40px gutter and $zen-reverse-all-floats */
40
+ $zen-column-count: 5;
41
+ $zen-gutter-width: 40px;
42
+ $zen-reverse-all-floats: true;
43
+ @include zen-grid-item(3, 3, right);
44
+ $zen-reverse-all-floats: false;
45
+
46
+ /* Test zen-grid-item(3, 2.5) with 5 column grid and 40px gutter */
47
+ $zen-column-count: 5;
48
+ $zen-gutter-width: 40px;
49
+ @include zen-grid-item(3, 2.5);
50
+
51
+ /* Test zen-grid-item(3, 3) with $zen-grid-width: 1000px, 5 column grid and 40px gutter */
52
+ $zen-grid-width: 1000px;
53
+ $zen-column-count: 5;
54
+ $zen-gutter-width: 40px;
55
+ @include zen-grid-item(3, 3);
56
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file
3
+ * Test zen-nested-container()
4
+ */
5
+
6
+ @import "zen";
7
+
8
+ #test-zen-nested-container {
9
+ /* Test zen-nested-container() */
10
+ @include zen-nested-container();
11
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file
3
+ * Test zen-direction-flip()
4
+ */
5
+ /* line 8, ../sass/function-zen-direction-flip.scss */
6
+ #test-zen-direction-flip {
7
+ /* Test zen-direction-flip(left) */
8
+ float: right;
9
+ /* Test zen-direction-flip(right) */
10
+ float: left;
11
+ /* Test zen-direction-flip(both) */
12
+ float: both;
13
+ /* Test zen-direction-flip(none) */
14
+ float: none;
15
+ /* Test zen-direction-flip(invalid) */
16
+ float: both;
17
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file
3
+ * Test zen-half-gutter()
4
+ */
5
+ /* line 8, ../sass/function-zen-half-gutter.scss */
6
+ #test-zen-half-gutter {
7
+ /* Test zen-half-gutter() with default $zen-gutter-width: 20px */
8
+ padding-left: 10px;
9
+ /* Test zen-half-gutter() with $zen-gutter-width: 30px */
10
+ padding-left: 15px;
11
+ /* Test zen-half-gutter(10em) */
12
+ padding-left: 5em;
13
+ /* Test zen-half-gutter(11em) */
14
+ padding-left: 5.5em;
15
+ /* Test zen-half-gutter(10px) */
16
+ padding-left: 5px;
17
+ /* Test zen-half-gutter(11px) */
18
+ padding-left: 5px;
19
+ /* Test zen-half-gutter(11px, right) */
20
+ padding-left: 6px;
21
+ /* Test zen-half-gutter(11px) with $zen-float-direction: right */
22
+ padding-left: 5px;
23
+ /* Test zen-half-gutter(11px, left) with $zen-float-direction: right */
24
+ padding-left: 6px;
25
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file
3
+ * Test zen-clear()
4
+ */
5
+ /* line 8, ../sass/zen-clear.scss */
6
+ #test-zen-clear {
7
+ /* Test zen-clear() */
8
+ clear: left;
9
+ /* Test zen-clear() with $zen-float-direction: right */
10
+ clear: right;
11
+ /* Test zen-clear(left) */
12
+ clear: left;
13
+ /* Test zen-clear(left, $reverse-all-floats: TRUE) */
14
+ clear: right;
15
+ /* Test zen-clear(left) with: $zen-reverse-all-floats: TRUE; */
16
+ clear: right;
17
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-container()
4
+ */
5
+ /* line 8, ../sass/zen-grid-container.scss */
6
+ #test-zen-grid-container {
7
+ /* Test zen-grid-container() */
8
+ position: relative;
9
+ overflow: hidden;
10
+ *zoom: 1;
11
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-flow-item()
4
+ */
5
+ /* line 8, ../sass/zen-grid-flow-item.scss */
6
+ #test-zen-grid-flow-item {
7
+ /* Test zen-grid-flow-item(1) without setting $column-count */
8
+ margin-left: -10px;
9
+ margin-right: 10px;
10
+ width: 8.333%;
11
+ padding-left: 10px;
12
+ padding-right: 10px;
13
+ -moz-box-sizing: border-box;
14
+ -webkit-box-sizing: border-box;
15
+ -ms-box-sizing: border-box;
16
+ box-sizing: border-box;
17
+ overflow: visible;
18
+ word-wrap: break-word;
19
+ /* Test zen-grid-flow-item(1, 4) with 12 column grid and 20px gutter */
20
+ margin-left: -10px;
21
+ margin-right: 10px;
22
+ width: 25%;
23
+ padding-left: 10px;
24
+ padding-right: 10px;
25
+ -moz-box-sizing: border-box;
26
+ -webkit-box-sizing: border-box;
27
+ -ms-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ overflow: visible;
30
+ word-wrap: break-word;
31
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter */
32
+ margin-left: -7px;
33
+ margin-right: 7px;
34
+ width: 25%;
35
+ padding-left: 7px;
36
+ padding-right: 8px;
37
+ -moz-box-sizing: border-box;
38
+ -webkit-box-sizing: border-box;
39
+ -ms-box-sizing: border-box;
40
+ box-sizing: border-box;
41
+ overflow: visible;
42
+ word-wrap: break-word;
43
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $zen-float-direction: right */
44
+ margin-right: -7px;
45
+ margin-left: 7px;
46
+ width: 25%;
47
+ padding-left: 8px;
48
+ padding-right: 7px;
49
+ -moz-box-sizing: border-box;
50
+ -webkit-box-sizing: border-box;
51
+ -ms-box-sizing: border-box;
52
+ box-sizing: border-box;
53
+ overflow: visible;
54
+ word-wrap: break-word;
55
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $alpha-gutter: true */
56
+ margin-left: 8px;
57
+ margin-right: 7px;
58
+ width: 25%;
59
+ padding-left: 7px;
60
+ padding-right: 8px;
61
+ -moz-box-sizing: border-box;
62
+ -webkit-box-sizing: border-box;
63
+ -ms-box-sizing: border-box;
64
+ box-sizing: border-box;
65
+ overflow: visible;
66
+ word-wrap: break-word;
67
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter and $omega-gutter: false */
68
+ margin-left: -7px;
69
+ margin-right: -8px;
70
+ width: 25%;
71
+ padding-left: 7px;
72
+ padding-right: 8px;
73
+ -moz-box-sizing: border-box;
74
+ -webkit-box-sizing: border-box;
75
+ -ms-box-sizing: border-box;
76
+ box-sizing: border-box;
77
+ overflow: visible;
78
+ word-wrap: break-word;
79
+ /* Test zen-grid-flow-item(1, 4) with 15px gutter, $zen-float-direction: right and $alpha-gutter: true */
80
+ margin-right: 8px;
81
+ margin-left: 7px;
82
+ width: 25%;
83
+ padding-left: 8px;
84
+ padding-right: 7px;
85
+ -moz-box-sizing: border-box;
86
+ -webkit-box-sizing: border-box;
87
+ -ms-box-sizing: border-box;
88
+ box-sizing: border-box;
89
+ overflow: visible;
90
+ word-wrap: break-word;
91
+ /* Test zen-grid-flow-item(1, 4) with $zen-box-sizing: content-box and 10% gutter */
92
+ margin-left: -5%;
93
+ margin-right: 5%;
94
+ width: 15%;
95
+ padding-left: 5%;
96
+ padding-right: 5%;
97
+ border: 0 !important;
98
+ overflow: visible;
99
+ word-wrap: break-word;
100
+ /* Test zen-grid-flow-item(1, 4) with $zen-auto-include-flow-item-base: false */
101
+ margin-left: -10px;
102
+ margin-right: 10px;
103
+ width: 25%;
104
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-item-base()
4
+ */
5
+ /* line 8, ../sass/zen-grid-item-base.scss */
6
+ #test-zen-grid-item-base {
7
+ /* Test zen-grid-item-base() */
8
+ padding-left: 10px;
9
+ padding-right: 10px;
10
+ -moz-box-sizing: border-box;
11
+ -webkit-box-sizing: border-box;
12
+ -ms-box-sizing: border-box;
13
+ box-sizing: border-box;
14
+ overflow: visible;
15
+ word-wrap: break-word;
16
+ /* Test zen-grid-item-base() with $zen-box-sizing: content-box */
17
+ padding-left: 10px;
18
+ padding-right: 10px;
19
+ border: 0 !important;
20
+ overflow: visible;
21
+ word-wrap: break-word;
22
+ /* Test zen-grid-item-base() with $legacy-support-for-ie7: true */
23
+ padding-left: 10px;
24
+ padding-right: 10px;
25
+ -moz-box-sizing: border-box;
26
+ -webkit-box-sizing: border-box;
27
+ -ms-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ overflow: visible;
30
+ word-wrap: break-word;
31
+ /* Test zen-grid-item-base() with $box-sizing-polyfill-path: "/boxsizing.htc" and $legacy-support-for-ie7: true */
32
+ padding-left: 10px;
33
+ padding-right: 10px;
34
+ -moz-box-sizing: border-box;
35
+ -webkit-box-sizing: border-box;
36
+ -ms-box-sizing: border-box;
37
+ box-sizing: border-box;
38
+ overflow: visible;
39
+ word-wrap: break-word;
40
+ *behavior: url("/boxsizing.htc");
41
+ /* Test zen-grid-item-base() with $box-sizing-polyfill-path: "/boxsizing.htc" and $legacy-support-for-ie6: true */
42
+ padding-left: 10px;
43
+ padding-right: 10px;
44
+ -moz-box-sizing: border-box;
45
+ -webkit-box-sizing: border-box;
46
+ -ms-box-sizing: border-box;
47
+ box-sizing: border-box;
48
+ overflow: visible;
49
+ word-wrap: break-word;
50
+ *behavior: url("/boxsizing.htc");
51
+ _display: inline;
52
+ _overflow: hidden;
53
+ _overflow-y: visible;
54
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px */
55
+ padding-left: 7px;
56
+ padding-right: 8px;
57
+ -moz-box-sizing: border-box;
58
+ -webkit-box-sizing: border-box;
59
+ -ms-box-sizing: border-box;
60
+ box-sizing: border-box;
61
+ overflow: visible;
62
+ word-wrap: break-word;
63
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px and $zen-float-direction: right */
64
+ padding-left: 8px;
65
+ padding-right: 7px;
66
+ -moz-box-sizing: border-box;
67
+ -webkit-box-sizing: border-box;
68
+ -ms-box-sizing: border-box;
69
+ box-sizing: border-box;
70
+ overflow: visible;
71
+ word-wrap: break-word;
72
+ /* Test zen-grid-item-base() with $zen-gutter-width: 15px and $zen-reverse-all-floats: true */
73
+ padding-left: 8px;
74
+ padding-right: 7px;
75
+ -moz-box-sizing: border-box;
76
+ -webkit-box-sizing: border-box;
77
+ -ms-box-sizing: border-box;
78
+ box-sizing: border-box;
79
+ overflow: visible;
80
+ word-wrap: break-word;
81
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @file
3
+ * Test zen-grid-item()
4
+ */
5
+ /* line 8, ../sass/zen-grid-item.scss */
6
+ #test-zen-grid-item {
7
+ /* Test zen-grid-item(6, 4) with 12 column grid and 20px gutter */
8
+ float: left;
9
+ width: 50%;
10
+ margin-left: 25%;
11
+ margin-right: -75%;
12
+ padding-left: 10px;
13
+ padding-right: 10px;
14
+ -moz-box-sizing: border-box;
15
+ -webkit-box-sizing: border-box;
16
+ -ms-box-sizing: border-box;
17
+ box-sizing: border-box;
18
+ overflow: visible;
19
+ word-wrap: break-word;
20
+ /* Test zen-grid-item(3, 3) with box-sizing: content-box, 5 column grid and 10% gutter */
21
+ float: left;
22
+ width: 50%;
23
+ margin-left: 40%;
24
+ margin-right: -100%;
25
+ padding-left: 5%;
26
+ padding-right: 5%;
27
+ border: 0 !important;
28
+ overflow: visible;
29
+ word-wrap: break-word;
30
+ /* Turn off $zen-auto-include-item-base */
31
+ /* Test zen-grid-item(3, 3) with 5 column grid and 40px gutter */
32
+ float: left;
33
+ width: 60%;
34
+ margin-left: 40%;
35
+ margin-right: -100%;
36
+ /* Test zen-grid-item(3, 3, right) with 5 column grid and 40px gutter */
37
+ float: right;
38
+ width: 60%;
39
+ margin-right: 40%;
40
+ margin-left: -100%;
41
+ /* Test zen-grid-item(3, 3) with 5 column grid and 40px gutter and $zen-reverse-all-floats */
42
+ float: right;
43
+ width: 60%;
44
+ margin-right: 40%;
45
+ margin-left: -100%;
46
+ /* Test zen-grid-item(3, 3, right) with 5 column grid and 40px gutter and $zen-reverse-all-floats */
47
+ float: left;
48
+ width: 60%;
49
+ margin-left: 40%;
50
+ margin-right: -100%;
51
+ /* Test zen-grid-item(3, 2.5) with 5 column grid and 40px gutter */
52
+ float: left;
53
+ width: 60%;
54
+ margin-left: 30%;
55
+ margin-right: -90%;
56
+ /* Test zen-grid-item(3, 3) with $zen-grid-width: 1000px, 5 column grid and 40px gutter */
57
+ float: left;
58
+ width: 600px;
59
+ margin-left: 400px;
60
+ margin-right: -1000px;
61
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file
3
+ * Test zen-nested-container()
4
+ */
5
+ /* line 8, ../sass/zen-nested-container.scss */
6
+ #test-zen-nested-container {
7
+ /* Test zen-nested-container() */
8
+ position: relative;
9
+ overflow: hidden;
10
+ *zoom: 1;
11
+ padding-left: 0;
12
+ padding-right: 0;
13
+ }
data/zen-grids.gemspec CHANGED
@@ -4,13 +4,13 @@ Gem::Specification.new do |s|
4
4
  s.name = 'zen-grids'
5
5
 
6
6
  s.summary = %q{A Compass plugin for Zen Grids, a fluid responsive grid system}
7
- s.description = %q{The Zen Grids system is a fluid responsive grid system that is immune to rounding errors and overflowing content. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts.}
7
+ s.description = %q{Zen Grids includes a fluid responsive grid system with an intuitive, flexible layout mechanism that leverages the natural source order of your content. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including adaptive and fixed-width layouts.}
8
8
 
9
9
  s.homepage = 'http://zengrids.com'
10
10
  s.rubyforge_project =
11
11
 
12
- s.version = '1.0.rc.1'
13
- s.date = '2012-02-18'
12
+ s.version = '1.0.rc.2'
13
+ s.date = '2012-04-03'
14
14
 
15
15
  s.authors = ['John Albin Wilkins']
16
16
  s.email = 'virtually.johnalbin@gmail.com'
@@ -23,13 +23,30 @@ Gem::Specification.new do |s|
23
23
  lib/zen-grids.rb
24
24
  stylesheets/_zen.scss
25
25
  stylesheets/zen/_background-grid.scss
26
- stylesheets/zen/_columns.scss
27
26
  stylesheets/zen/_grids.scss
28
27
  templates/project/example.html
29
28
  templates/project/manifest.rb
30
29
  templates/project/common.scss
31
30
  templates/project/layout.scss
32
31
  templates/project/styles.scss
32
+ templates/unit-tests/manifest.rb
33
+ templates/unit-tests/README.txt
34
+ templates/unit-tests/sass/function-zen-direction-flip.scss
35
+ templates/unit-tests/sass/function-zen-half-gutter.scss
36
+ templates/unit-tests/sass/zen-clear.scss
37
+ templates/unit-tests/sass/zen-grid-container.scss
38
+ templates/unit-tests/sass/zen-grid-flow-item.scss
39
+ templates/unit-tests/sass/zen-grid-item-base.scss
40
+ templates/unit-tests/sass/zen-grid-item.scss
41
+ templates/unit-tests/sass/zen-nested-container.scss
42
+ templates/unit-tests/test-results/function-zen-direction-flip.css
43
+ templates/unit-tests/test-results/function-zen-half-gutter.css
44
+ templates/unit-tests/test-results/zen-clear.css
45
+ templates/unit-tests/test-results/zen-grid-container.css
46
+ templates/unit-tests/test-results/zen-grid-flow-item.css
47
+ templates/unit-tests/test-results/zen-grid-item-base.css
48
+ templates/unit-tests/test-results/zen-grid-item.css
49
+ templates/unit-tests/test-results/zen-nested-container.css
33
50
  zen-grids.gemspec
34
51
  ]
35
52
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zen-grids
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424247
5
- prerelease: 4
4
+ prerelease: true
6
5
  segments:
7
6
  - 1
8
7
  - 0
9
8
  - rc
10
- - 1
11
- version: 1.0.rc.1
9
+ - 2
10
+ version: 1.0.rc.2
12
11
  platform: ruby
13
12
  authors:
14
13
  - John Albin Wilkins
@@ -16,24 +15,23 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2012-02-18 00:00:00 Z
18
+ date: 2012-04-03 00:00:00 +08:00
19
+ default_executable:
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
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 5
30
28
  segments:
31
29
  - 3
32
30
  - 1
33
31
  version: "3.1"
34
32
  type: :runtime
35
33
  version_requirements: *id001
36
- description: The Zen Grids system is a fluid responsive grid system that is immune to rounding errors and overflowing content. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts.
34
+ description: Zen Grids includes a fluid responsive grid system with an intuitive, flexible layout mechanism that leverages the natural source order of your content. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including adaptive and fixed-width layouts.
37
35
  email: virtually.johnalbin@gmail.com
38
36
  executables: []
39
37
 
@@ -47,14 +45,32 @@ files:
47
45
  - lib/zen-grids.rb
48
46
  - stylesheets/_zen.scss
49
47
  - stylesheets/zen/_background-grid.scss
50
- - stylesheets/zen/_columns.scss
51
48
  - stylesheets/zen/_grids.scss
52
49
  - templates/project/example.html
53
50
  - templates/project/manifest.rb
54
51
  - templates/project/common.scss
55
52
  - templates/project/layout.scss
56
53
  - templates/project/styles.scss
54
+ - templates/unit-tests/manifest.rb
55
+ - templates/unit-tests/README.txt
56
+ - templates/unit-tests/sass/function-zen-direction-flip.scss
57
+ - templates/unit-tests/sass/function-zen-half-gutter.scss
58
+ - templates/unit-tests/sass/zen-clear.scss
59
+ - templates/unit-tests/sass/zen-grid-container.scss
60
+ - templates/unit-tests/sass/zen-grid-flow-item.scss
61
+ - templates/unit-tests/sass/zen-grid-item-base.scss
62
+ - templates/unit-tests/sass/zen-grid-item.scss
63
+ - templates/unit-tests/sass/zen-nested-container.scss
64
+ - templates/unit-tests/test-results/function-zen-direction-flip.css
65
+ - templates/unit-tests/test-results/function-zen-half-gutter.css
66
+ - templates/unit-tests/test-results/zen-clear.css
67
+ - templates/unit-tests/test-results/zen-grid-container.css
68
+ - templates/unit-tests/test-results/zen-grid-flow-item.css
69
+ - templates/unit-tests/test-results/zen-grid-item-base.css
70
+ - templates/unit-tests/test-results/zen-grid-item.css
71
+ - templates/unit-tests/test-results/zen-nested-container.css
57
72
  - zen-grids.gemspec
73
+ has_rdoc: true
58
74
  homepage: http://zengrids.com
59
75
  licenses: []
60
76
 
@@ -64,20 +80,16 @@ rdoc_options: []
64
80
  require_paths:
65
81
  - lib
66
82
  required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
83
  requirements:
69
84
  - - ">="
70
85
  - !ruby/object:Gem::Version
71
- hash: 3
72
86
  segments:
73
87
  - 0
74
88
  version: "0"
75
89
  required_rubygems_version: !ruby/object:Gem::Requirement
76
- none: false
77
90
  requirements:
78
91
  - - ">"
79
92
  - !ruby/object:Gem::Version
80
- hash: 25
81
93
  segments:
82
94
  - 1
83
95
  - 3
@@ -85,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
97
  version: 1.3.1
86
98
  requirements: []
87
99
 
88
- rubyforge_project: 1.0.rc.1
89
- rubygems_version: 1.8.15
100
+ rubyforge_project: 1.0.rc.2
101
+ rubygems_version: 1.3.6
90
102
  signing_key:
91
103
  specification_version: 3
92
104
  summary: A Compass plugin for Zen Grids, a fluid responsive grid system
@@ -1,253 +0,0 @@
1
- //
2
- // Mixins for Zen Columns layout method.
3
- //
4
-
5
- $zen-columns-box-sizing: content-box !default;
6
- $legacy-support-for-ie6: true !default;
7
-
8
-
9
- //
10
- // This mixin should be applied to a container so that the children items become
11
- // columns arranged with the Zen Columns layout method.
12
- //
13
- // The mixin has the following required parameters:
14
- // - $selectors: A list of selectors for all the columns inside the container.
15
- // In this list, order the columns as you would like them to appear from
16
- // left-to-right (or right-to-left when the $leading-direction is "right".)
17
- // Note that the HTML for the columns can be in any order in the HTML source.
18
- // - $widths: A list of widths. Each one corresponds to a column specified in
19
- // $selectors. e.g. The first width is for the first column. The second width
20
- // is for the second column. etc.
21
- //
22
- // The mixin has the following optional parameters:
23
- // - $box-sizing: The type of CSS3 box model each column should use. Can be set
24
- // to content-box or border-box. Defaults to content-box, but border-box is
25
- // way cooler. IE 6 and 7 don't support border-box.
26
- // - $leading-direction: The direction the columns should float. Can be set to
27
- // "left" or "right". An extremely advanced option allows you to specify a
28
- // a list of directions, one direction for each column.
29
- // - $leading-gutters: A list of leading gutters; one per column. The leading
30
- // gutter specifies the distance between the current column and the column
31
- // floated just before it.
32
- // - $padding: A list of padding measurements; one per column. In order to
33
- // specify a complex padding value like "0 4px 2px", you can use nested lists,
34
- // e.g. $padding: ((0 4px 2px), (3px 0), (10px 5px 5px 10px))
35
- // In order to use the same padding measurements for all columns, you can
36
- // simply list one measurement total instead of one per column,
37
- // e.g. $padding: ((5px 10px))
38
- //
39
- // In addition to standard columns, the mixin supports one horizontal navbar
40
- // that will appear (with a fixed height) above all the other columns. The
41
- // parameters for this optional navbar are:
42
- // - $navbar-selector: The selector for the navbar. It should be a child item of
43
- // the container just as a normal column is.
44
- // - $navbar-height: The fixed height of the navbar. Required if the
45
- // $navbar-selector is used.
46
- // - $navbar-width: The width of the navbar. Defaults to 100% of the container
47
- // width.
48
- // - $navbar-leading-gutter: An optional leading space between the navbar and
49
- // and the container's inner edge. If specified, the $navbar-width must also
50
- // be specified so that the width plus leading gutter plus padding isn't
51
- // greater than 100% of the container's width.
52
- // - $navbar-padding: An optional padding for the navbar. If specified, the
53
- // $navbar-width must also be specified so that the width plus leading gutter
54
- // plus padding isn't greater than 100% of the container's width.
55
- //
56
- @mixin zen-columns (
57
- // Information about the columns.
58
- $box-sizing: $zen-columns-box-sizing,
59
- $selectors: ('.sidebar1', '.content', '.sidebar2'),
60
- $widths: (),
61
- $leading-direction: (),
62
- $leading-gutters: (),
63
- $padding: (),
64
-
65
- // Information about the navbar.
66
- $navbar-selector: false,
67
- $navbar-height: 0,
68
- $navbar-width: 100%,
69
- $navbar-leading-gutter: 0,
70
- $navbar-padding: 0
71
- ) {
72
-
73
- // Allow some parameters to be simple strings instead of lists.
74
- @if type_of($widths) != list {
75
- $widths: ($widths);
76
- }
77
- @if type_of($leading-direction) != list {
78
- $leading-direction: ($leading-direction);
79
- }
80
- @if type_of($leading-gutters) != list {
81
- $leading-gutters: ($leading-gutters);
82
- }
83
- @if type_of($padding) != list {
84
- $padding: ($padding);
85
- }
86
- @if type_of($navbar-padding) != list {
87
- $navbar-padding: ($navbar-padding);
88
- }
89
-
90
- // Declare all our variables so they can be used in any child block scope.
91
- $col: 0;
92
- $float: left;
93
- @if length($leading-direction) > 0 {
94
- $float: nth($leading-direction, 1);
95
- }
96
- $gutter: 0;
97
- $left-fill: 0;
98
- $left-reset: 0;
99
- $right-fill: 0;
100
- $right-reset: 0;
101
- $margin: 0;
102
- $padding-values: 0;
103
- $padding-x: 0;
104
- $navbar-padding-x: 0;
105
- $navbar-padding-y: 0;
106
- $navbar-reset: 0;
107
- $navbar-true-height: 0;
108
- $container-children: $selectors;
109
-
110
- @if $navbar-selector {
111
- // Determine the padding height and width of the navbar.
112
- $navbar-padding-x: 2 * nth($navbar-padding, 1);
113
- $navbar-padding-y: 2 * nth($navbar-padding, 1);
114
- @if length($navbar-padding) == 4 {
115
- $navbar-padding-x: nth($navbar-padding, 2) + nth($navbar-padding, 4);
116
- }
117
- @else if length($navbar-padding) >= 2 {
118
- $navbar-padding-x: 2 * nth($navbar-padding, 2);
119
- }
120
- @if length($navbar-padding) >= 3 {
121
- $navbar-padding-y: nth($navbar-padding, 1) + nth($navbar-padding, 3);
122
- }
123
- // We only keep track of the padding for content-box layouts.
124
- @if $box-sizing == border-box {
125
- $navbar-padding-x: 0;
126
- }
127
- // Determine the distance of the navbar's right edge from the container's left edge.
128
- $navbar-reset: -$navbar-leading-gutter - $navbar-width - $navbar-padding-x;
129
- // The columns need to know the true height of the navbar box.
130
- $navbar-true-height: $navbar-height + $navbar-padding-y;
131
- // Add the navbar to the list of the selectors of the container's children.
132
- $container-children: append($container-children, $navbar-selector);
133
- }
134
-
135
- // #{} interpolation doesn't work when converting lists into selectors, so
136
- // convert the list into an unquoted string before using it.
137
- $string: false;
138
- @each $child in $container-children {
139
- @if $string == false {
140
- $string: unquote($child);
141
- }
142
- @else {
143
- $string: unquote($string + ', ' + $child);
144
- }
145
- }
146
- $container-children: $string;
147
-
148
- // Iterate over each column.
149
- @each $column in $selectors {
150
- // Number the columns.
151
- $col: $col + 1;
152
- // Find the width, floating direction and gutter of the current column.
153
- $width: nth($widths, $col);
154
- @if $col <= length($leading-direction) {
155
- $float: nth($leading-direction, $col);
156
- }
157
- @if $col <= length($leading-gutters) {
158
- $gutter: nth($leading-gutters, $col);
159
- }
160
- // Calculate the left/right padding as it affects the true width of the column.
161
- @if $col <= length($padding) {
162
- $padding-values: nth($padding, $col);
163
- @if type_of($padding-values) != list {
164
- $padding-values: ($padding-values);
165
- }
166
- $padding-x: 2 * nth($padding-values, 1);
167
- @if length($padding-values) == 4 {
168
- $padding-x: nth($padding-values, 2) + nth($padding-values, 4);
169
- }
170
- @else if length($padding-values) > 1 {
171
- $padding-x: 2 * nth($padding-values, 2);
172
- }
173
- }
174
- // We only keep track of the padding for content-box layouts.
175
- @if $box-sizing == border-box {
176
- $padding-x: 0;
177
- }
178
- // If the column is floating from the left, determine the distance from the
179
- // container's left edge to the column's left edge ($left-fill) and to the
180
- // column's right edge ($left-reset).
181
- @if $float == left {
182
- $left-fill: $left-fill + $gutter;
183
- $left-reset: -$left-fill - $padding-x - $width;
184
- $margin: $navbar-true-height $left-reset 0 $left-fill;
185
- // The next column needs to know how much the previous columns have filled.
186
- $left-fill: $left-fill + $width + $padding-x;
187
- }
188
- // If the column is floating from the right, determine the distance from the
189
- // container's right edge to the column's right edge ($right-fill) and to
190
- // the column's left edge ($right-reset).
191
- @else {
192
- $right-fill: $right-fill + $gutter;
193
- $right-reset: -$right-fill - $padding-x - $width;
194
- $margin: $navbar-true-height $right-fill 0 $right-reset;
195
- // The next column needs to know how much the previous columns have filled.
196
- $right-fill: $right-fill + $width + $padding-x;
197
- }
198
-
199
- // Apply rules to the columns.
200
- #{$column} {
201
- float: $float;
202
- width: $width;
203
- margin: $margin;
204
- padding: $padding-values;
205
- }
206
- }
207
-
208
- // Apply rules to the container.
209
- position: relative;
210
-
211
- // Apply rules to the navbar.
212
- @if $navbar-selector {
213
- #{$navbar-selector} {
214
- float: $float;
215
- height: $navbar-height;
216
- margin: 0 $navbar-reset 0 $navbar-leading-gutter;
217
- width: $navbar-width;
218
- padding: $navbar-padding;
219
- }
220
- }
221
-
222
- // Apply rules to navbar and columns.
223
- #{$container-children} {
224
- // Specify the border-box properties.
225
- @if $box-sizing == border-box {
226
- -moz-box-sizing: border-box;
227
- -webkit-box-sizing: border-box;
228
- -ms-box-sizing: border-box;
229
- box-sizing: border-box;
230
- }
231
- // Prevent borders since they'll break the layout with content-box.
232
- @if $box-sizing == content-box {
233
- border: 0 !important;
234
- }
235
- // Prevent overflowing content from breaking the layout.
236
- overflow: visible;
237
- word-wrap: break-word; // A very nice CSS3 property.
238
-
239
- @if $legacy-support-for-ie6 and $box-sizing == content-box {
240
- .ie6 & {
241
- display: inline; // display inline or double your floated margin! [1]
242
- overflow: hidden; // in IE6, overflow auto is broken [2] and so is overflow visible [3]
243
- overflow-y: visible;
244
- }
245
- }
246
- }
247
- }
248
-
249
- // REFERENCES
250
- //
251
- // 1. http://www.positioniseverything.net/explorer/doubled-margin.html
252
- // 2. http://browservulsel.blogspot.com/2005/04/ie-overflow-auto-scrollbar-overlap.html
253
- // 3. http://www.howtocreate.co.uk/wrongWithIE/?chapter=overflow%3Avisible%3B