zen-grids 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/package.json +9 -9
- data/sass/homepage.md +18 -0
- data/sass/zen-grids/_background.scss +28 -14
- data/sass/zen-grids/_flow.scss +45 -31
- data/sass/zen-grids/_functions.scss +28 -24
- data/sass/zen-grids/_grids.scss +108 -9
- data/sass/zen-grids/_layout.scss +63 -45
- data/sass/zen-grids/_undo.scss +90 -18
- data/sass/zen-grids/_variables.scss +132 -69
- data/zen-grids.gemspec +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d85c1798a0d60a010f9ce016b8f58c51e326cee0
|
4
|
+
data.tar.gz: 44595b1786ff0d5c91cfd5ce9af64bdd2357c423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f516ed94c05f6f7c93b4128829813f504bbba0e899badc6525e44c04a17188e1fc7127df22e02f3f062cf7436276cad9715c3ea3496e5c366b86a5a34e9d126f
|
7
|
+
data.tar.gz: 33eb2a00c39b5522f246d3d493468fd8198c4c33db9d86600a9cef08f750c8f7997a86c9daaf383b45089f01da6fe15d19503d9c874d2d462295a231d2f152c3
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "zen-grids",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.2",
|
4
4
|
"description": "Zen Grids is an intuitive, flexible grid system to create responsive, adaptive, fluid and fixed-width layouts.",
|
5
5
|
"homepage": "https://github.com/JohnAlbin/zen-grids",
|
6
6
|
"bugs": {
|
@@ -22,8 +22,9 @@
|
|
22
22
|
"main": "sass/_zen-grids.scss",
|
23
23
|
"style": "sass/_zen-grids.scss",
|
24
24
|
"eyeglass": {
|
25
|
-
"
|
26
|
-
"
|
25
|
+
"sassDir": "sass",
|
26
|
+
"exports": false,
|
27
|
+
"needs": "*"
|
27
28
|
},
|
28
29
|
"directories": {
|
29
30
|
"lib": "sass",
|
@@ -35,13 +36,12 @@
|
|
35
36
|
},
|
36
37
|
"license": "GPL-2.0",
|
37
38
|
"devDependencies": {
|
38
|
-
"chai": "^3.
|
39
|
-
"eslint": "^
|
40
|
-
"eyeglass": "^0.
|
41
|
-
"
|
42
|
-
"mocha": "^2.3.4",
|
39
|
+
"chai": "^3.5.0",
|
40
|
+
"eslint": "^2.9.0",
|
41
|
+
"eyeglass": "^0.8.3",
|
42
|
+
"mocha": "^2.4.5",
|
43
43
|
"node-sass-import-once": "^1.2.0",
|
44
|
-
"sassy-test": "^
|
44
|
+
"sassy-test": "^3.0.0",
|
45
45
|
"support-for": "^1.0.0"
|
46
46
|
}
|
47
47
|
}
|
data/sass/homepage.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
## Zen Grids 2.0
|
2
|
+
|
3
|
+
### Reference documentation
|
4
|
+
|
5
|
+
This documentation is for the new 2.0 version of Zen Grids. Pardon our dust while we get the _design_ up-to-date. Rest asured, the docs are up-to-date.
|
6
|
+
|
7
|
+
For the previous Zen Grids 1.x documentation, see [v1.zengrids.com](http://v1.zengrids.com).
|
8
|
+
|
9
|
+
### Modules
|
10
|
+
|
11
|
+
Zen Grids 2.0 is divided into small modules that small and logical, making it easy to load and easier to understand.
|
12
|
+
|
13
|
+
- [The “grids” module](section-grids.html) contains most of the configurable variables and mixins you’ll need to create a layout.
|
14
|
+
- [The “flow” module](section-flow.html) helps align normal flow items within a grid.
|
15
|
+
- [The “layout” module](section-layout.html) helps to create a set of grids for responsive designs.
|
16
|
+
- [The “undo” module](section-undo.html) helps undo CSS applied in different media queries.
|
17
|
+
- [The “helper functions” module](section-functions.html) contains functions you may need to create a layout.
|
18
|
+
- [The “background” module](section-background.html) is used during development to help see the grid columns
|
@@ -7,6 +7,8 @@
|
|
7
7
|
// @import "zen-grids/background";
|
8
8
|
// ```
|
9
9
|
//
|
10
|
+
// Weight: 20
|
11
|
+
//
|
10
12
|
// Style guide: background
|
11
13
|
|
12
14
|
@import "./grids";
|
@@ -18,26 +20,38 @@
|
|
18
20
|
//
|
19
21
|
// Adds a background grid image to an element’s background.
|
20
22
|
//
|
21
|
-
// Common usage:
|
22
|
-
// ```
|
23
|
-
// @include zen-grid-background();
|
24
|
-
// ```
|
25
|
-
//
|
26
23
|
// 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.)
|
27
24
|
//
|
28
25
|
// 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
26
|
//
|
30
27
|
// 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
28
|
//
|
32
|
-
//
|
33
|
-
//
|
34
|
-
//
|
35
|
-
//
|
36
|
-
//
|
37
|
-
//
|
38
|
-
//
|
39
|
-
//
|
40
|
-
//
|
29
|
+
// ```
|
30
|
+
// .layout-container {
|
31
|
+
// @include zen-grid-background();
|
32
|
+
// @include zen-layout(m) {
|
33
|
+
// @include zen-grid-background();
|
34
|
+
// }
|
35
|
+
// @include zen-layout(l) {
|
36
|
+
// @include zen-grid-background();
|
37
|
+
// }
|
38
|
+
// }
|
39
|
+
// ```
|
40
|
+
//
|
41
|
+
// Common usage:
|
42
|
+
// ```
|
43
|
+
// @include zen-grid-background();
|
44
|
+
// ```
|
45
|
+
//
|
46
|
+
// $columns = $zen-columns - The number of columns for this background. See the docs for [`$zen-columns`](section-grids.html#kssref-grids-variables-zen-columns).
|
47
|
+
// $gutters = $zen-gutters - The width of the gutters for this background. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
48
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use for this background. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
49
|
+
// $grid-width = $zen-grid-width - The width of the entire grid for this background. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-fixed-zen-grid-width).
|
50
|
+
// $grid-color = $zen-grid-color - The column color to use for the background grid image.
|
51
|
+
// $grid-numbers = $zen-grid-numbers - Specify the set of images used for the numbering of the columns in the background grid image.
|
52
|
+
// $direction = $zen-direction - The direction to use for this background. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
53
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction for this background. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
54
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this background. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
41
55
|
//
|
42
56
|
// Style guide: background.zen-grid-background
|
43
57
|
@mixin zen-grid-background(
|
data/sass/zen-grids/_flow.scss
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
// Flow module
|
2
2
|
//
|
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.
|
4
|
-
//
|
5
3
|
// 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
4
|
//
|
5
|
+
// To understand this module, it is important to understand the CSS definition of “normal flow”. According to CSS, all content is part of the [normal <em>flow</em>](http://www.w3.org/TR/CSS2/visuren.html#positioning-scheme) by default. For example, paragraph text and images are part of the normal flow.
|
6
|
+
//
|
7
|
+
// Positioned elements (floats, absolute positioning, etc.) are not part of the normal flow.
|
8
|
+
//
|
9
|
+
// Zen Grid’s grid items are also positioned elements and, therefore, are no longer part of the normal flow.
|
10
|
+
//
|
11
|
+
// For example, a layout designer will often make one of Zen Grid’s grid items span multiple columns. The elements within that grid item are part of the normal flow and span the same number of columns as their containing grid item. The layout designer may wish to have an element in the normal flow align to one or more of the columns within the grid item. For example, if a grid item spans 3 columns, the layout designer may want to have all of the images within it to align to the first column inside that grid item and have other flow items wrap around those images.
|
12
|
+
//
|
13
|
+
// Weight: -8
|
14
|
+
//
|
7
15
|
// Style guide: flow
|
8
16
|
|
9
17
|
@import "./grids";
|
@@ -11,6 +19,12 @@
|
|
11
19
|
|
12
20
|
// zen-flow-item-width()
|
13
21
|
//
|
22
|
+
// 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.
|
23
|
+
//
|
24
|
+
// 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`.
|
25
|
+
//
|
26
|
+
// 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.
|
27
|
+
//
|
14
28
|
// Common usage:
|
15
29
|
// ```
|
16
30
|
// @include zen-flow-item-width(
|
@@ -42,25 +56,19 @@
|
|
42
56
|
// );
|
43
57
|
// ```
|
44
58
|
//
|
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.
|
46
|
-
//
|
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`.
|
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
59
|
// $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.)
|
54
|
-
// $omega-gutter - Whether the flow item should have a gutter on its right (or, for RTL layouts, on its left.)
|
55
|
-
// $direction -
|
56
|
-
// $columns -
|
57
|
-
// $gutters -
|
58
|
-
// $gutter-method -
|
59
|
-
// $grid-width -
|
60
|
-
// $box-sizing -
|
61
|
-
// $switch-direction -
|
62
|
-
// $rtl-selector -
|
63
|
-
// $include-base -
|
60
|
+
// $parent-column-span = false - Required for %-based layouts, but not for fixed-width layouts. The number of columns the parent grid item spans.
|
61
|
+
// $alpha-gutter = false - Whether the flow item should have a gutter on its left (or, for RTL layouts, on its right.)
|
62
|
+
// $omega-gutter = true - Whether the flow item should have a gutter on its right (or, for RTL layouts, on its left.)
|
63
|
+
// $direction = $zen-direction - The direction to use. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
64
|
+
// $columns = $zen-columns - The number of columns in the grid. See the docs for [`$zen-columns`](section-grids.html#kssref-grids-variables-zen-columns).
|
65
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
66
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
67
|
+
// $grid-width = $zen-grid-width - The width of the entire grid. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-fixed-zen-grid-width).
|
68
|
+
// $box-sizing = $zen-box-sizing - The box sizing to use. See the docs for [`$zen-box-sizing`](section-grids.html#kssref-grids-variables-zen-box-sizing).
|
69
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
70
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this background. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
71
|
+
// $include-base = $zen-auto-include-flow-item-base - Whether to auto-include the zen-flow-item-base() mixin. See the docs for [`$zen-auto-include-flow-item-base`](section-flow.html#kssref-grids-variables-zen-auto-include-flow-item-base).
|
64
72
|
//
|
65
73
|
// Style guide: flow.zen-flow-item-width
|
66
74
|
@mixin zen-flow-item-width(
|
@@ -224,19 +232,19 @@
|
|
224
232
|
|
225
233
|
// zen-flow-item-base()
|
226
234
|
//
|
235
|
+
// Applies a standard set of properties to flow items that are aligned to the grid.
|
236
|
+
//
|
227
237
|
// Common usage:
|
228
238
|
// ```
|
229
239
|
// @include zen-flow-item-base();
|
230
240
|
// ```
|
231
241
|
//
|
232
|
-
//
|
233
|
-
//
|
234
|
-
// $
|
235
|
-
// $
|
236
|
-
// $
|
237
|
-
// $
|
238
|
-
// $switch-direction - Defaults to `$zen-switch-direction`
|
239
|
-
// $rtl-selector - Defaults to `$zen-rtl-selector`
|
242
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
243
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
244
|
+
// $box-sizing = $zen-box-sizing - The box sizing to use. See the docs for [`$zen-box-sizing`](section-grids.html#kssref-grids-variables-zen-box-sizing).
|
245
|
+
// $direction = $zen-direction - The direction to use. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
246
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
247
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this background. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
240
248
|
//
|
241
249
|
// Style guide: flow.zen-flow-item-base
|
242
250
|
@mixin zen-flow-item-base(
|
@@ -260,14 +268,20 @@
|
|
260
268
|
//
|
261
269
|
// Apply this to flow items that need to be floated.
|
262
270
|
//
|
271
|
+
// Using this mixin is longer than just typing `float: left;`. However, this mixin integrates with the RTL variables and mixins so that the direction of floating can be changed automatically.
|
272
|
+
//
|
263
273
|
// Common usage:
|
264
274
|
// ```
|
265
275
|
// @include zen-float();
|
266
276
|
// ```
|
277
|
+
// or:
|
278
|
+
// ```
|
279
|
+
// @include zen-float(right);
|
280
|
+
// ```
|
267
281
|
//
|
268
|
-
// $direction
|
269
|
-
// $switch-direction -
|
270
|
-
// $rtl-selector
|
282
|
+
// $direction = $zen-direction - The direction to use. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
283
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
284
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this background. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
271
285
|
//
|
272
286
|
// Style guide: flow.zen-float
|
273
287
|
@mixin zen-float(
|
@@ -2,6 +2,10 @@
|
|
2
2
|
//
|
3
3
|
// Helper functions for the Zen Grids mixins.
|
4
4
|
//
|
5
|
+
// This module contains many Sass functions that you may find useful in your style sheet. These functions are also used internally by all of the mixins in Zen Grids.
|
6
|
+
//
|
7
|
+
// Weight: 10
|
8
|
+
//
|
5
9
|
// Style guide: functions
|
6
10
|
|
7
11
|
|
@@ -23,9 +27,9 @@
|
|
23
27
|
// }
|
24
28
|
// ```
|
25
29
|
//
|
26
|
-
// $gutters -
|
27
|
-
// $gutter-side -
|
28
|
-
// $direction -
|
30
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
31
|
+
// $gutter-side = $zen-direction - The side of the grid item the gutter is needed for.
|
32
|
+
// $direction = $zen-direction - The direction to use. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
29
33
|
//
|
30
34
|
// weight: -1
|
31
35
|
//
|
@@ -78,10 +82,10 @@
|
|
78
82
|
// }
|
79
83
|
// ```
|
80
84
|
//
|
81
|
-
// $columns -
|
82
|
-
// $gutters -
|
83
|
-
// $gutter-method -
|
84
|
-
// $grid-width -
|
85
|
+
// $columns = $zen-columns - The number of columns in the grid. See the docs for [`$zen-columns`](section-grids.html#kssref-grids-variables-zen-columns).
|
86
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
87
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
88
|
+
// $grid-width = $zen-grid-width - The width of the entire grid. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-fixed-zen-grid-width).
|
85
89
|
//
|
86
90
|
// weight: -1
|
87
91
|
//
|
@@ -114,6 +118,8 @@
|
|
114
118
|
|
115
119
|
// zen-grid-item-width()
|
116
120
|
//
|
121
|
+
// Calculates the width of a grid item that spans the specified number of columns.
|
122
|
+
//
|
117
123
|
// Common usage:
|
118
124
|
// ```
|
119
125
|
// .ex {
|
@@ -121,14 +127,12 @@
|
|
121
127
|
// }
|
122
128
|
// ```
|
123
129
|
//
|
124
|
-
//
|
125
|
-
//
|
126
|
-
// $
|
127
|
-
// $
|
128
|
-
// $
|
129
|
-
// $
|
130
|
-
// $grid-width - Defaults to `$zen-grid-width`
|
131
|
-
// $box-sizing - Defaults to `$zen-box-sizing`
|
130
|
+
// $column-span - Required. The number of columns to calculate the width of.
|
131
|
+
// $columns = $zen-columns - The number of columns in the grid. See the docs for [`$zen-columns`](section-grids.html#kssref-grids-variables-zen-columns).
|
132
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
133
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
134
|
+
// $grid-width = $zen-grid-width - The width of the entire grid. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-fixed-zen-grid-width).
|
135
|
+
// $box-sizing = $zen-box-sizing - The box sizing to use. See the docs for [`$zen-box-sizing`](section-grids.html#kssref-grids-variables-zen-box-sizing).
|
132
136
|
//
|
133
137
|
// Style guide: functions.zen-grid-item-width
|
134
138
|
@function zen-grid-item-width(
|
@@ -155,6 +159,8 @@
|
|
155
159
|
|
156
160
|
// zen-direction-switch()
|
157
161
|
//
|
162
|
+
// Returns the opposite direction, given "left" or "right".
|
163
|
+
//
|
158
164
|
// Common usage:
|
159
165
|
// ```
|
160
166
|
// .ex {
|
@@ -162,26 +168,24 @@
|
|
162
168
|
// }
|
163
169
|
// ```
|
164
170
|
//
|
165
|
-
//
|
166
|
-
//
|
167
|
-
// Returns the opposite direction, given "left" or "right".
|
171
|
+
// $direction - Required. The direction you want to switch.
|
168
172
|
//
|
169
|
-
//
|
173
|
+
// weight: 1
|
170
174
|
//
|
171
175
|
// Style guide: functions.zen-direction-switch
|
172
176
|
@function zen-direction-switch(
|
173
|
-
$
|
177
|
+
$direction
|
174
178
|
) {
|
175
|
-
@if $
|
179
|
+
@if $direction == left {
|
176
180
|
@return right;
|
177
181
|
}
|
178
|
-
@else if $
|
182
|
+
@else if $direction == right {
|
179
183
|
@return left;
|
180
184
|
}
|
181
|
-
@else if $
|
185
|
+
@else if $direction != none and $direction != both {
|
182
186
|
@warn "Invalid direction passed to zen-direction-switch().";
|
183
187
|
}
|
184
|
-
@return $
|
188
|
+
@return $direction;
|
185
189
|
}
|
186
190
|
|
187
191
|
// zen-support-for-ie()
|
data/sass/zen-grids/_grids.scss
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
// Grids module
|
1
2
|
//
|
2
|
-
//
|
3
|
+
// The “grids” module contains most of the configurable variables and mixins you’ll need to create a layout.
|
3
4
|
//
|
4
|
-
|
5
|
+
// Weight: -10
|
6
|
+
//
|
7
|
+
// Style guide: grids
|
5
8
|
|
6
9
|
// Import the global variables needed by all of Zen Grids.
|
7
10
|
@import "./variables";
|
@@ -14,7 +17,9 @@
|
|
14
17
|
//
|
15
18
|
// Since `$zen-rtl-selector` defaults to `false`, inline Right-To-Left language support is off by default.
|
16
19
|
//
|
17
|
-
// $selector -
|
20
|
+
// $selector = $zen-rtl-selector - The RTL selector for this grid item. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
21
|
+
//
|
22
|
+
// weight: 20
|
18
23
|
//
|
19
24
|
// Style guide: grids.zen-rtl
|
20
25
|
|
@@ -33,10 +38,33 @@
|
|
33
38
|
}
|
34
39
|
}
|
35
40
|
|
41
|
+
// zen-grid-container()
|
36
42
|
//
|
37
43
|
// Apply this to create a grid container element.
|
38
|
-
// @see http://next.zengrids.com/reference/grids/#zen-grid-container
|
39
44
|
//
|
45
|
+
// If this grid is nested inside another grid, the `$context` parameter can be used to align the nested grid with the parent grid. `$context` can be set to `none` (the default), `grid-item`, or `flow`.
|
46
|
+
//
|
47
|
+
// If the nested grid’s container is a child element of the parent grid’s grid item, set `$context: flow`.
|
48
|
+
//
|
49
|
+
// Otherwise, if the nested grid’s container is the same element as the parent grid’s grid item, set `$context: grid-item` and apply this mixin *after* the [`zen-grid-item()`](#kssref-grids-zen-grid-item) mixin is applied for the parent grid. This mixin removes any gutters on the container since the nested grid will have its own gutters.
|
50
|
+
//
|
51
|
+
// Common usage:
|
52
|
+
// ```
|
53
|
+
// @include zen-grid-container();
|
54
|
+
// ```
|
55
|
+
// or:
|
56
|
+
// ```
|
57
|
+
// @include zen-grid-container(grid-item);
|
58
|
+
// ```
|
59
|
+
//
|
60
|
+
// $context = none - If this grid is nested inside another grid, the `$context` parameter can be used to align the nested grid with the parent grid. It can be set to `none`, `grid-item`, or `flow`.
|
61
|
+
// $gutters = $zen-gutters - The width of the gutters for this container. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
62
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use for this container. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
63
|
+
// $direction = $zen-direction - The direction to use for this container. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
64
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction for this container. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
65
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this container. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
66
|
+
//
|
67
|
+
// Style guide: grids.zen-grid-container
|
40
68
|
@mixin zen-grid-container(
|
41
69
|
$context : none,
|
42
70
|
$gutters : $zen-gutters,
|
@@ -107,9 +135,36 @@
|
|
107
135
|
}
|
108
136
|
}
|
109
137
|
|
138
|
+
// zen-grid-item()
|
139
|
+
//
|
140
|
+
// Apply this to each grid item. Set the `$column-span` to the number of columns that the grid item spans. And set the `$column-position` to the column number the grid item starts on.
|
141
|
+
//
|
142
|
+
// To make the grid item float from the right, set the `$direction` to `right`; it defaults to `left` (the value of `$zen-direction`.) For grid items that are floated right, the `$column-position` is counted from the right instead of from the left.
|
110
143
|
//
|
111
|
-
//
|
144
|
+
// Common usage:
|
145
|
+
// ```
|
146
|
+
// // The grid item spans 2 columns starting from the 3rd column from the left,
|
147
|
+
// // e.g. It spans columns 3 and 4 counting from the left.
|
148
|
+
// @include zen-grid-item($column-span: 2, $column-position: 3);
|
149
|
+
// ```
|
150
|
+
// or:
|
151
|
+
// ```
|
152
|
+
// // The grid item spans 2 columns starting from the 3rd column from the right,
|
153
|
+
// // e.g. It spans columns 3 and 4 counting from the right.
|
154
|
+
// @include zen-grid-item(2, 3, right);
|
155
|
+
// ```
|
112
156
|
//
|
157
|
+
// $column-span - Required. The number of columns the grid item will span.
|
158
|
+
// $column-position - Required. The column number the grid item starts on.
|
159
|
+
// $direction = $zen-direction - The floating direction to use for this grid item. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
160
|
+
// $gutters = $zen-gutters - The width of the gutters for this grid item. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
161
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use for this grid item. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
162
|
+
// $box-sizing = $zen-box-sizing - The box sizing to use for this grid item. See the docs for [`$zen-box-sizing`](section-grids.html#kssref-grids-variables-zen-box-sizing).
|
163
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction for this grid item. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
164
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this grid item. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
165
|
+
// $include-base = $zen-auto-include-grid-item-base - Whether to auto-include the zen-grid-item-base() mixin. See the docs for [`$zen-auto-include-grid-item-base`](section-grids.html#kssref-grids-variables-zen-auto-include-grid-item-base).
|
166
|
+
//
|
167
|
+
// Style guide: grids.zen-grid-item
|
113
168
|
@mixin zen-grid-item(
|
114
169
|
$column-span,
|
115
170
|
$column-position,
|
@@ -175,10 +230,27 @@
|
|
175
230
|
}
|
176
231
|
}
|
177
232
|
|
233
|
+
// zen-grid-item-base()
|
234
|
+
//
|
235
|
+
// Applies a standard set of properties for grid items in the layout.
|
236
|
+
//
|
237
|
+
// See the documentation for the [`$zen-auto-include-grid-item-base`](#kssref-grids-variables-zen-auto-include-grid-item-base) and [`$zen-auto-include-flow-item-base`](section-flow.html#kssref-flow-variables-zen-auto-include-flow-item-base) variables for when to use this mixin.
|
238
|
+
//
|
239
|
+
// Common usage:
|
240
|
+
// ```
|
241
|
+
// @include zen-grid-item-base();
|
242
|
+
// ```
|
243
|
+
//
|
244
|
+
// $gutters = $zen-gutters - The width of the gutters for this grid item. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
245
|
+
// $gutter-method = $zen-gutter-method - The gutter method to use for this grid item. See the docs for [`$zen-gutter-method`](section-grids.html#kssref-grids-variables-zen-gutter-method).
|
246
|
+
// $box-sizing = $zen-box-sizing - The box sizing to use for this grid item. See the docs for [`$zen-box-sizing`](section-grids.html#kssref-grids-variables-zen-box-sizing).
|
247
|
+
// $direction = $zen-direction - The floating direction to use for this grid item. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
248
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction for this grid item. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
249
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this grid item. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
178
250
|
//
|
179
|
-
//
|
180
|
-
// @see http://next.zengrids.com/reference/grids/#zen-grid-item-base
|
251
|
+
// weight: 10
|
181
252
|
//
|
253
|
+
// Style guide: grids.zen-grid-item-base
|
182
254
|
@mixin zen-grid-item-base(
|
183
255
|
$gutters : $zen-gutters,
|
184
256
|
$gutter-method : $zen-gutter-method,
|
@@ -235,10 +307,24 @@
|
|
235
307
|
}
|
236
308
|
}
|
237
309
|
|
310
|
+
// zen-new-row()
|
238
311
|
//
|
239
312
|
// Apply this to a grid item so that it starts a new row.
|
240
|
-
// @see http://next.zengrids.com/reference/grids/#zen-new-row
|
241
313
|
//
|
314
|
+
// Common usage:
|
315
|
+
// ```
|
316
|
+
// @include zen-new-row();
|
317
|
+
// ```
|
318
|
+
// or:
|
319
|
+
// ```
|
320
|
+
// @include zen-new-row(right);
|
321
|
+
// ```
|
322
|
+
//
|
323
|
+
// $clear = $zen-direction - The floating direction to use for this grid item. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
324
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction for this grid item. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
325
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector for this grid item. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
326
|
+
//
|
327
|
+
// Style guide: grids.zen-new-row
|
242
328
|
@mixin zen-new-row(
|
243
329
|
$clear : $zen-direction,
|
244
330
|
$switch-direction : $zen-switch-direction,
|
@@ -257,10 +343,23 @@
|
|
257
343
|
}
|
258
344
|
}
|
259
345
|
|
346
|
+
// zen-apply-gutter-padding()
|
260
347
|
//
|
261
348
|
// Applies the gutter to a grid item when using the padding gutter method.
|
262
|
-
// @see http://next.zengrids.com/reference/grids/#zen-apply-gutter-padding
|
263
349
|
//
|
350
|
+
// Common usage:
|
351
|
+
// ```
|
352
|
+
// @include zen-apply-gutter-padding();
|
353
|
+
// ```
|
354
|
+
//
|
355
|
+
// $gutters = $zen-gutters - The width of the gutters. See the docs for [`$zen-gutters`](section-grids.html#kssref-grids-variables-zen-gutters).
|
356
|
+
// $direction = $zen-direction - The floating direction to use. See the docs for [`$zen-direction`](section-grids.html#kssref-grids-variables-rtl-zen-direction).
|
357
|
+
// $switch-direction = $zen-switch-direction - Whether to switch the default direction. See the docs for [`$zen-switch-direction`](section-grids.html#kssref-grids-variables-rtl-zen-switch-direction).
|
358
|
+
// $rtl-selector = $zen-rtl-selector - The RTL selector. See the docs for [`$zen-rtl-selector`](section-grids.html#kssref-grids-variables-rtl-zen-rtl-selector).
|
359
|
+
//
|
360
|
+
// weight: 30
|
361
|
+
//
|
362
|
+
// Style guide: grids.zen-apply-gutter-padding
|
264
363
|
@mixin zen-apply-gutter-padding(
|
265
364
|
$gutters : $zen-gutters,
|
266
365
|
$direction : $zen-direction,
|