zen-grids 2.0.0.beta.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 640e160d3d90ce3d3a930b5740266c31d022cbd0
4
- data.tar.gz: cf59ab172bb8f008b606da496e1f02e6d31a0093
3
+ metadata.gz: 8bda392f20e20968fade42052a73cedbc99eaaea
4
+ data.tar.gz: bf6d195eb10faf1b3577e57ebc1c120b9d58af07
5
5
  SHA512:
6
- metadata.gz: 45d2429e4d3cda23119af1b68449a56d0ed2e0184b75e70380945fbd49a6502e7ed5b21389aee9bfe69b9c7b63c34526762d98427d3679a16b30af70934e6346
7
- data.tar.gz: 874e8c1b4eb80ed77f8ea8cfb9a001b0d38eb1f512ea05a88ca24a8319cb8a4049ea4c15adeae811804331d5c5224a59aeb17a9073c9c50d981f3d855db7a04a
6
+ metadata.gz: 5c2b044056fddca6254df441e6f83ce6c1d0432efb882109bbdcd5eb58ddc347d6d016e757e078b6db68651b53d6f6c30f35d9a5daff214891fb7d75b24ba920
7
+ data.tar.gz: d51d6512a419e1eba488c899d124c9cb216901a17f77ac7a932d30d97281848afecfef3e3e4be8bd166437dc1141a6cc5f1735413e5d37349f42c6921aeb4e6a
File without changes
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  Zen Grids is an intuitive, flexible grid system that leverages the natural source order of your content to make it easier to create fluid responsive designs. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including responsive, adaptive, fluid and fixed-width layouts.
4
4
 
5
- More information can be found at http://next.zengrids.com
6
-
5
+ More information can be found at http://zengrids.com
7
6
 
8
7
  ## USAGE
9
8
 
@@ -38,26 +37,15 @@ Here's a simple example: a content column with a sidebar on each side, aligned t
38
37
 
39
38
  Within the `.container` element, the `.sidebar1`, `.sidebar2` and `.content` elements can be in any order.
40
39
 
41
- Zen Grids has built-in support for the Box-sizing Polyfill which adds `box-sizing: border-box` support to IE7 and earlier.
42
-
43
- * Download the polyfill at https://github.com/Schepp/box-sizing-polyfill
44
- * Place the `boxsizing.htc` file in your website.
45
- * Set Zen Grids' `$box-sizing-polyfill-path` variable to the absolute path to the boxsizing.htc file on your website. For example: `$box-sizing-polyfill-path: "/scripts/polyfills/boxsizing.htc";`
46
-
47
-
48
40
  ## INSTALLATION
49
41
 
50
- Zen grids is distributed as a Ruby Gem. On your computer, simply run:
51
-
52
- ```sh
53
- gem install zen-grids
54
- ```
42
+ Install using one of the following methods:
55
43
 
56
- If you are using Compass (and you should!) then you can add it to an existing project by editing the project's configuration file, config.rb, and adding this line:
57
-
58
- ```ruby
59
- require 'zen-grids'
60
- ```
44
+ * Install with [npm](http://npmjs.org/): `npm install --save zen-grids`
45
+ * Install with [Bower](http://bower.io/): `bower install --save zen-grids`
46
+ * Install with [Ruby Gem](https://rubygems.org/gems/zen-grids): `gem install zen-grids`<br>
47
+ and, if using Compass, add `require "zen-grids"` to your config.rb file.
48
+ * Install with [Bundler](http://bundler.io/) and Ruby Gem: `bundle inject zen-grids '~> 2.0'`
61
49
 
62
50
  You can then start using Zen Grids in your Sass files. Just add this line to one of your .sass or .scss files and start creating!
63
51
 
@@ -65,14 +53,9 @@ You can then start using Zen Grids in your Sass files. Just add this line to one
65
53
  @import "zen-grids";
66
54
  ```
67
55
 
68
-
69
56
  ## REQUIREMENTS
70
57
 
71
- * Sass 3.3.0 or later
72
-
73
- For the zen-grids/background module only:
74
- * Compass 1.0.0 or later
75
-
58
+ Now works with **libSass** or Ruby Sass!
76
59
 
77
60
  ## LICENSE
78
61
 
data/bower.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "zen-grids",
3
+ "description": "Zen Grids is an intuitive, flexible grid system to create responsive, adaptive, fluid and fixed-width layouts.",
4
+ "main": [
5
+ "sass/_zen-grids.scss"
6
+ ],
7
+ "authors": [
8
+ "John Albin Wilkins <virtually.johnalbin@gmail.com> (http://john.albin.net/)"
9
+ ],
10
+ "license": "GPL-2.0",
11
+ "keywords": [
12
+ "sass",
13
+ "layout",
14
+ "grid",
15
+ "rwd",
16
+ "responsive-web-design"
17
+ ],
18
+ "homepage": "http://zengrids.com",
19
+ "ignore": [
20
+ "**/.*",
21
+ "lib",
22
+ "node_modules",
23
+ "sache.json",
24
+ "test",
25
+ "zen-grids.gemspec"
26
+ ]
27
+ }
data/lib/zen-grids.rb CHANGED
@@ -1,10 +1,17 @@
1
- require 'compass'
2
-
3
1
  project_path = File.join(File.dirname(__FILE__), '..')
4
2
  stylesheets_path = File.join(project_path, 'sass')
5
3
 
6
- Compass::Frameworks.register(
7
- 'zen-grids',
8
- :path => project_path,
9
- :stylesheets_directory => stylesheets_path
10
- )
4
+ if (defined? Compass)
5
+ Compass::Frameworks.register(
6
+ 'zen-grids',
7
+ :path => project_path,
8
+ :stylesheets_directory => stylesheets_path
9
+ )
10
+ else
11
+ # Compass not defined, register the Sass path via an environment variable.
12
+ if ENV.has_key?('SASS_PATH')
13
+ ENV['SASS_PATH'] = ENV['SASS_PATH'] + File::PATH_SEPARATOR + stylesheets_path
14
+ else
15
+ ENV['SASS_PATH'] = stylesheets_path
16
+ end
17
+ end
data/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "zen-grids",
3
+ "version": "2.0.0",
4
+ "description": "Zen Grids is an intuitive, flexible grid system to create responsive, adaptive, fluid and fixed-width layouts.",
5
+ "homepage": "https://github.com/JohnAlbin/zen-grids",
6
+ "bugs": {
7
+ "url": "https://github.com/JohnAlbin/zen-grids/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git://github.com/JohnAlbin/zen-grids.git"
12
+ },
13
+ "author": "John Albin Wilkins <virtually.johnalbin@gmail.com> (http://john.albin.net/)",
14
+ "keywords": [
15
+ "sass",
16
+ "layout",
17
+ "grid",
18
+ "rwd",
19
+ "responsive-web-design"
20
+ ],
21
+ "main": "sass/_zen-grids.scss",
22
+ "style": "sass/_zen-grids.scss",
23
+ "eyeglass": {
24
+ "exports": "eyeglass-exports.js"
25
+ },
26
+ "directories": {
27
+ "lib": "sass",
28
+ "test": "test"
29
+ },
30
+ "scripts": {
31
+ "test": "mocha",
32
+ "posttest": "eslint test"
33
+ },
34
+ "license": "GPL-2.0",
35
+ "devDependencies": {
36
+ "chai": "^3.4.1",
37
+ "eslint": "^1.9.0",
38
+ "eyeglass": "^0.6.3",
39
+ "kss": "^2.1.0",
40
+ "mocha": "^2.3.4",
41
+ "node-sass-import-once": "^1.2.0",
42
+ "sassy-test": "^2.0.0",
43
+ "support-for": "^1.0.0"
44
+ }
45
+ }
@@ -1,19 +1,45 @@
1
+ // Background module
1
2
  //
2
- // "Background grid image" module for the Zen Grids system.
3
+ // During site development, it’s often useful to have a background image that shows the columns of the grid. The "Background grid image" module for the Zen Grids system provides a mixin to set this background image.
3
4
  //
5
+ // Note: This module is not automatically loaded with `@import "zen-grids";`. Before using it, you must first import the module with:
6
+ // ```
7
+ // @import "zen-grids/background";
8
+ // ```
9
+ //
10
+ // Style guide: background
4
11
 
5
-
6
- @import "./functions";
12
+ @import "./grids";
7
13
  // Add the default set of background images.
8
14
  @import "./internal/variables-background";
9
- // Unlike the rest of Zen Grids, this module requires Compass.
10
- @import "compass/css3/images";
11
15
 
12
16
 
17
+ // zen-grid-background()
18
+ //
19
+ // Adds a background grid image to an element’s background.
20
+ //
21
+ // Common usage:
22
+ // ```
23
+ // @include zen-grid-background();
24
+ // ```
13
25
  //
14
- // Add a background grid image to an element's background.
15
- // @see http://next.zengrids.com/reference/background/#zen-grid-background
26
+ // Since the mixins of Zen Grids use the `$column-position` for placement of grid items, the background grid image produced by this mixin numbers all of the columns. The `$grid-numbers` parameter specifies how to place the column numbers in the background grid image. By default, column numbers are displayed across the top of the background grid image and then displayed in reverse order along the bottom of the background grid image. `$grid-numbers` can be set to: `both` (the default), `top` (don’t display the bottom numbers), `bottom` (don’t display the top numbers), or `none` (don’t display any column numbers.)
16
27
  //
28
+ // Note: when the `$direction` is set to `right` (for RTL languages), the column numbers are displayed right-to-left along the top and left-to-right along the bottom.
29
+ //
30
+ // The easiest way to align this background grid image to the actual grid is to apply this mixin to the same element that `zen-grid-container()` is applied to.
31
+ //
32
+ // $columns - Defaults to `$zen-columns`
33
+ // $gutters - Defaults to `$zen-gutters`
34
+ // $gutter-method - Defaults to `$zen-gutter-method`
35
+ // $grid-width - Defaults to `$zen-grid-width`
36
+ // $grid-color - Defaults to `$zen-grid-color`
37
+ // $grid-numbers - Defaults to `$zen-grid-numbers`
38
+ // $direction - Defaults to `$zen-direction`
39
+ // $switch-direction - Defaults to `$zen-switch-direction`
40
+ // $rtl-selector - Defaults to `$zen-rtl-selector`
41
+ //
42
+ // Style guide: background.zen-grid-background
17
43
  @mixin zen-grid-background(
18
44
  $columns : $zen-columns,
19
45
  $gutters : $zen-gutters,
@@ -22,7 +48,8 @@
22
48
  $grid-color : $zen-grid-color,
23
49
  $grid-numbers : $zen-grid-numbers,
24
50
  $direction : $zen-direction,
25
- $switch-direction : $zen-switch-direction
51
+ $switch-direction : $zen-switch-direction,
52
+ $rtl-selector : $zen-rtl-selector
26
53
  ) {
27
54
 
28
55
  // Check if the global variable is turning off background images.
@@ -128,14 +155,28 @@
128
155
 
129
156
  // Last, add the gradient (or gradient halves) to the background images list.
130
157
  @if $gutter-method == margin or comparable($gutters, $grid-width) {
131
- $bg-images : append($bg-images, linear-gradient(left, $gradient) left top no-repeat, comma);
158
+ $bg-images : append($bg-images, linear-gradient(to right, $gradient) left top no-repeat, comma);
132
159
  }
133
160
  @else {
134
- $bg-images : append($bg-images, linear-gradient(left, $left-half-gradient) zen-half-gutter($gutters) top no-repeat, comma);
135
- $bg-images : append($bg-images, linear-gradient(left, $right-half-gradient) (-(zen-half-gutter($gutters))) top no-repeat, comma);
161
+ $bg-images : append($bg-images, linear-gradient(to right, $left-half-gradient) zen-half-gutter($gutters) top no-repeat, comma);
162
+ $bg-images : append($bg-images, linear-gradient(to right, $right-half-gradient) (-(zen-half-gutter($gutters))) top no-repeat, comma);
136
163
  }
137
164
 
138
165
  // Apply the full list of background images.
139
- @include background($bg-images);
166
+ background: $bg-images;
167
+
168
+ @include zen-rtl($rtl-selector) {
169
+ @include zen-grid-background(
170
+ $columns : $zen-columns,
171
+ $gutters : $zen-gutters,
172
+ $gutter-method : $zen-gutter-method,
173
+ $grid-width : $zen-grid-width,
174
+ $grid-color : $zen-grid-color,
175
+ $grid-numbers : $zen-grid-numbers,
176
+ $direction : zen-direction-switch($zen-direction),
177
+ $switch-direction : $zen-switch-direction,
178
+ $rtl-selector : false
179
+ );
180
+ }
140
181
  }
141
182
  }
@@ -1,15 +1,68 @@
1
+ // Flow module
1
2
  //
2
- // "Flow" module for the Zen Grids system.
3
+ // In your grid system, some HTML elements are grid containers and some HTML elements are grid items. Most of your content will be inside a grid item. According to CSS terminology, the unpositioned HTML elements inside a grid item are in the “normal flow” of a document.
3
4
  //
4
-
5
+ // The "Flow" module for the Zen Grids system allows an item in the normal flow of a document to be aligned to the grid, e.g. an image can be aligned to the grid.
6
+ //
7
+ // Style guide: flow
5
8
 
6
9
  @import "./grids";
7
10
 
8
11
 
12
+ // zen-flow-item-width()
13
+ //
14
+ // Common usage:
15
+ // ```
16
+ // @include zen-flow-item-width(
17
+ // [column-span],
18
+ // $parent-column-span: [integer]
19
+ // );
20
+ // ```
21
+ // or:
22
+ // ```
23
+ // @include zen-flow-item-width(
24
+ // [column-span],
25
+ // $parent-column-span: [integer],
26
+ // $alpha-gutter: [boolean],
27
+ // $omega-gutter: [boolean]
28
+ // );
29
+ // ```
30
+ // or for fixed length (em, px, etc.) layouts:
31
+ // ```
32
+ // @include zen-flow-item-width(
33
+ // [column-span]
34
+ // );
35
+ // ```
36
+ // or:
37
+ // ```
38
+ // @include zen-flow-item-width(
39
+ // [column-span],
40
+ // $alpha-gutter: [boolean],
41
+ // $omega-gutter: [boolean]
42
+ // );
43
+ // ```
44
+ //
45
+ // Apply this to an HTML item that is in the normal flow of a document to help align it to the grid. Set the `$column-span` to the number of columns that the HTML element should span. For responsive layouts with a percentage-based grid width, set the `$parent-column-span` to the number of columns that the parent element spans; fixed-unit layouts using px, em, etc. do not need to specify this.
9
46
  //
10
- // Apply this to an HTML item that is in the normal flow of a document to help
11
- // align it to the grid. @see http://next.zengrids.com/reference/flow/#zen-float
47
+ // Unlike the `zen-grid-item()` mixin, this mixin does not float the HTML item; see the related `zen-float()` mixin. This mixin also does not have a half-gutter on each side. By default, it has no gutter in the "alpha position" (the left side) and a full gutter in the "omega position" (the right side.) You can turn on or off the alpha and omega gutters by setting the `$alpha-gutter` and `$omega-gutter` parameters to `true` or `false`.
12
48
  //
49
+ // Note: when the `$direction` is set to `right` (for RTL languages), the alpha position is on the right and the omega position is on the left.
50
+ //
51
+ // $column-span - Required. The number of columns the flow item will span.
52
+ // $parent-column-span - Required for %-based layouts, but not for fixed-width layouts. The number of columns the parent grid item spans.
53
+ // $alpha-gutter - Whether the flow item should have a gutter on its left (or, for RTL layouts, on its right.) Defaults to `false`.
54
+ // $omega-gutter - Whether the flow item should have a gutter on its right (or, for RTL layouts, on its left.) Defaults to `true`.
55
+ // $direction - Defaults to `$zen-direction`
56
+ // $columns - Defaults to `$zen-columns`
57
+ // $gutters - Defaults to `$zen-gutters`
58
+ // $gutter-method - Defaults to `$zen-gutter-method`
59
+ // $grid-width - Defaults to `$zen-grid-width`
60
+ // $box-sizing - Defaults to `$zen-box-sizing`
61
+ // $switch-direction - Defaults to `$zen-switch-direction`
62
+ // $rtl-selector - Defaults to `$zen-rtl-selector`
63
+ // $include-base - Defaults to `$zen-auto-include-flow-item-base`
64
+ //
65
+ // Style guide: flow.zen-flow-item-width
13
66
  @mixin zen-flow-item-width(
14
67
  $column-span,
15
68
  $parent-column-span : false,
@@ -22,6 +75,7 @@
22
75
  $grid-width : $zen-grid-width,
23
76
  $box-sizing : $zen-box-sizing,
24
77
  $switch-direction : $zen-switch-direction,
78
+ $rtl-selector : $zen-rtl-selector,
25
79
  $include-base : $zen-auto-include-flow-item-base
26
80
  ) {
27
81
 
@@ -39,8 +93,7 @@
39
93
  @else {
40
94
  // If we don't know the number of columns the parent element spans, then
41
95
  // warn the user and force the flow item to span 100% of the parent.
42
- @warn "For responsive layouts with a percentage-based grid width, you must set the $parent-column-span to the number of columns that the parent element spans.";
43
- $column-span: $columns;
96
+ @error "For responsive layouts with a percentage-based grid width, you must set the $parent-column-span to the number of columns that the parent element spans.";
44
97
  }
45
98
  // We want our inner grid to span the entire width of the parent.
46
99
  $grid-width: 100%;
@@ -63,7 +116,7 @@
63
116
 
64
117
  // Include the flow item base mixin.
65
118
  @if $include-base {
66
- @include zen-flow-item-base($gutters, $gutter-method, $box-sizing, $direction, $switch-direction);
119
+ @include zen-flow-item-base($gutters, $gutter-method, $box-sizing, $direction, $switch-direction, $rtl-selector);
67
120
  }
68
121
 
69
122
  // Calculate the item's width.
@@ -80,6 +133,18 @@
80
133
  @if $omega-gutter {
81
134
  margin-#{$rev}: $gutters;
82
135
  }
136
+ @if not ($omega-gutter and $omega-gutter) {
137
+ @include zen-rtl($rtl-selector) {
138
+ @if $alpha-gutter {
139
+ margin-#{$dir}: 0;
140
+ margin-#{$rev}: $gutters;
141
+ }
142
+ @else if $omega-gutter {
143
+ margin-#{$rev}: 0;
144
+ margin-#{$dir}: $gutters;
145
+ }
146
+ }
147
+ }
83
148
  }
84
149
  @else if unit($grid-width) == "%" {
85
150
  // Our percentage $width is off since the parent has $main-gutters padding.
@@ -98,6 +163,19 @@
98
163
  @else {
99
164
  margin-#{$rev}: -($adjusted-gutter);
100
165
  }
166
+ @include zen-rtl($rtl-selector) {
167
+ padding-#{$rev}: 0;
168
+ @if $alpha-gutter {
169
+ margin-#{$rev}: $gutters;
170
+ }
171
+ padding-#{$dir}: $adjusted-gutter;
172
+ @if $omega-gutter {
173
+ margin-#{$dir}: $gutters - $adjusted-gutter;
174
+ }
175
+ @else {
176
+ margin-#{$dir}: -($adjusted-gutter);
177
+ }
178
+ }
101
179
  }
102
180
  @else {
103
181
  @if $alpha-gutter and $omega-gutter {
@@ -106,6 +184,15 @@
106
184
  #{$dir}: zen-half-gutter($gutters, left, $dir);
107
185
  #{$rev}: zen-half-gutter($gutters, right, $dir);
108
186
  }
187
+ // If $gutters is an odd number of pixels, we need special RTL handling.
188
+ @if zen-half-gutter($gutters, left, $dir) != zen-half-gutter($gutters, right, $dir) {
189
+ @include zen-rtl($rtl-selector) {
190
+ margin: {
191
+ left: zen-half-gutter($gutters, right, $dir);
192
+ right: zen-half-gutter($gutters, left, $dir);
193
+ }
194
+ }
195
+ }
109
196
  }
110
197
  }
111
198
  @else if not $alpha-gutter and not $omega-gutter {
@@ -119,41 +206,74 @@
119
206
  @else if $omega-gutter {
120
207
  padding-#{$dir}: 0;
121
208
  padding-#{$rev}: $gutters;
209
+ @include zen-rtl($rtl-selector) {
210
+ padding-#{$rev}: 0;
211
+ padding-#{$dir}: $gutters;
212
+ }
122
213
  }
123
214
  @else {
124
215
  padding-#{$dir}: $gutters;
125
216
  padding-#{$rev}: 0;
217
+ @include zen-rtl($rtl-selector) {
218
+ padding-#{$rev}: $gutters;
219
+ padding-#{$dir}: 0;
220
+ }
126
221
  }
127
222
  }
128
223
  }
129
224
 
225
+ // zen-flow-item-base()
226
+ //
227
+ // Common usage:
228
+ // ```
229
+ // @include zen-flow-item-base();
230
+ // ```
130
231
  //
131
- // Applies a standard set of properites to all flow items.
132
- // @see http://next.zengrids.com/reference/grids/#zen-grid-item-base
232
+ // Applies a standard set of properties to all flow items.
133
233
  //
234
+ // $gutters - Defaults to `$zen-gutters`
235
+ // $gutter-method - Defaults to `$zen-gutter-method`
236
+ // $box-sizing - Defaults to `$zen-box-sizing`
237
+ // $direction - Defaults to `$zen-direction`
238
+ // $switch-direction - Defaults to `$zen-switch-direction`
239
+ // $rtl-selector - Defaults to `$zen-rtl-selector`
240
+ //
241
+ // Style guide: flow.zen-flow-item-base
134
242
  @mixin zen-flow-item-base(
135
243
  $gutters : $zen-gutters,
136
244
  $gutter-method : $zen-gutter-method,
137
245
  $box-sizing : $zen-box-sizing,
138
246
  $direction : $zen-direction,
139
- $switch-direction : $zen-switch-direction
247
+ $switch-direction : $zen-switch-direction,
248
+ $rtl-selector : $zen-rtl-selector
140
249
  ) {
141
250
 
142
- // Since we have to set padding in zen-flow-item-width(), supress extraneous
251
+ // Since we have to set padding in zen-flow-item-width(), suppress extraneous
143
252
  // padding declarations in the base by setting $gutter-method to none.
144
253
  @if $gutter-method == padding {
145
254
  $gutter-method: none;
146
255
  }
147
- @include zen-grid-item-base($gutters, $gutter-method, $box-sizing, $direction, $switch-direction);
256
+ @include zen-grid-item-base($gutters, $gutter-method, $box-sizing, $direction, $switch-direction, $rtl-selector);
148
257
  }
149
258
 
259
+ // zen-float()
150
260
  //
151
261
  // Apply this to flow items that need to be floated.
152
- // @see http://next.zengrids.com/reference/flow/#zen-float
153
262
  //
263
+ // Common usage:
264
+ // ```
265
+ // @include zen-float();
266
+ // ```
267
+ //
268
+ // $direction - Defaults to `$zen-direction`
269
+ // $switch-direction - Defaults to `$zen-switch-direction`
270
+ // $rtl-selector - Defaults to `$zen-rtl-selector`
271
+ //
272
+ // Style guide: flow.zen-float
154
273
  @mixin zen-float(
155
274
  $direction : $zen-direction,
156
- $switch-direction : $zen-switch-direction
275
+ $switch-direction : $zen-switch-direction,
276
+ $rtl-selector : $zen-rtl-selector
157
277
  ) {
158
278
  // Determine the float direction.
159
279
  $dir: $direction;
@@ -161,5 +281,8 @@
161
281
  $dir: zen-direction-switch($dir);
162
282
  }
163
283
  float: $dir;
164
- }
165
284
 
285
+ @include zen-rtl($rtl-selector) {
286
+ float: zen-direction-switch($dir);
287
+ }
288
+ }