zen-grids 1.5 → 2.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -16,13 +16,13 @@ USAGE
16
16
  Here's a simple example: a content column with a sidebar on each side, aligned
17
17
  to a 12 column grid.
18
18
 
19
- @import "zen";
19
+ @import "zen-grids";
20
20
 
21
21
  $zen-gutter-width: 40px; // Set the gutter size. A half-gutter is used on
22
22
  // each side of each column.
23
23
 
24
24
  .container {
25
- @include zen-grid-container(); // Define the container for your grid items.
25
+ @include zen-grid-container; // Define the container for your grid items.
26
26
  }
27
27
 
28
28
  $zen-column-count: 12; // Set the number of grid columns to use in this media
@@ -31,13 +31,13 @@ to a 12 column grid.
31
31
 
32
32
  @media all and (min-width: 50em) {
33
33
  .sidebar1 {
34
- @include zen-grid-item(3, 1); // Span 3 columns starting in 1st column.
34
+ @include zen-grid-item(3, 1); // Span 3 columns starting in 1st column
35
35
  }
36
36
  .content {
37
- @include zen-grid-item(6, 4); // Span 6 columns starting in 4th column.
37
+ @include zen-grid-item(6, 4); // Span 6 columns starting in 4th column
38
38
  }
39
39
  .sidebar2 {
40
- @include zen-grid-item(3, 10); // Span 3 columns starting in 10th column.
40
+ @include zen-grid-item(3, 10); // Span 3 columns starting in 10th column
41
41
  }
42
42
  }
43
43
 
@@ -70,16 +70,14 @@ line:
70
70
  You can then start using Zen Grids in your Sass files. Just add this line to one
71
71
  of your .sass or .scss files and start creating!
72
72
 
73
- @import "zen";
73
+ @import "zen-grids";
74
74
 
75
75
 
76
76
  REQUIREMENTS
77
77
  ------------
78
78
 
79
- - Sass 3.2 or later
80
-
81
- For the zen/background module only:
82
- - Compass 0.12 or later
79
+ - Sass 3.1 or later
80
+ - Compass 0.11 or later
83
81
 
84
82
 
85
83
  LICENSE
data/_zen-grids.scss ADDED
@@ -0,0 +1,3 @@
1
+ // Import the partials for Zen Grids.
2
+
3
+ @import "zen-grids/grids";
data/component.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "zen-grids",
3
+ "version": "2.0.0-alpha.1",
4
+ "author": ["John Albin Wilkins"],
5
+ "homepage": "http://zengrids.com/",
6
+ "styles": [
7
+ "_zen-grids.scss",
8
+ "zen-grids/_background.scss",
9
+ "zen-grids/_flow.scss",
10
+ "zen-grids/_grids.scss"
11
+ ],
12
+ "main": [
13
+ "_zen-grids.scss",
14
+ "zen-grids/_background.scss",
15
+ "zen-grids/_flow.scss",
16
+ "zen-grids/_grids.scss"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/JohnAlbin/compass-zen-grids.git"
21
+ },
22
+ "licenses": {
23
+ "type": "GPLv2",
24
+ "url": "http://www.gnu.org/licenses/gpl-2.0.html"
25
+ }
26
+ }
data/lib/zen-grids.rb CHANGED
@@ -1,3 +1,12 @@
1
1
  require 'compass'
2
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
- Compass::Frameworks.register('zen-grids', :path => extension_path)
2
+
3
+ project_path = File.join(File.dirname(__FILE__), '..')
4
+ stylesheets_path = File.join(project_path)
5
+ templates_path = File.join(project_path, 'templates')
6
+
7
+ Compass::Frameworks.register(
8
+ 'zen-grids',
9
+ :path => project_path,
10
+ :stylesheets_directory => stylesheets_path,
11
+ :templates_directory => templates_path
12
+ )
@@ -16,6 +16,7 @@ $zen-auto-include-item-base : false;
16
16
  //
17
17
  // Import our modules.
18
18
  //
19
- @import "zen";
20
- @import "zen/background";
19
+ @import "zen-grids";
20
+ @import "zen-grids/background";
21
+ @import "zen-grids/flow";
21
22
  @import "visually-hidden";
@@ -6,7 +6,6 @@ stylesheet 'sass/function-zen-half-gutter.scss', :media => 'all', :to => 'fu
6
6
  stylesheet 'sass/function-zen-unit-width.scss', :media => 'all', :to => 'function-zen-unit-width.scss'
7
7
  stylesheet 'sass/zen-clear.scss', :media => 'all', :to => 'zen-clear.scss'
8
8
  stylesheet 'sass/zen-float.scss', :media => 'all', :to => 'zen-float.scss'
9
- stylesheet 'sass/zen-grid-background.scss', :media => 'all', :to => 'zen-grid-background.scss'
10
9
  stylesheet 'sass/zen-grid-container.scss', :media => 'all', :to => 'zen-grid-container.scss'
11
10
  stylesheet 'sass/zen-grid-flow-item.scss', :media => 'all', :to => 'zen-grid-flow-item.scss'
12
11
  stylesheet 'sass/zen-grid-item-base.scss', :media => 'all', :to => 'zen-grid-item-base.scss'
@@ -19,7 +18,6 @@ file 'test-results/function-zen-half-gutter.css'
19
18
  file 'test-results/function-zen-unit-width.css'
20
19
  file 'test-results/zen-clear.css'
21
20
  file 'test-results/zen-float.css'
22
- file 'test-results/zen-grid-background.css'
23
21
  file 'test-results/zen-grid-container.css'
24
22
  file 'test-results/zen-grid-flow-item.css'
25
23
  file 'test-results/zen-grid-item-base.css'
@@ -3,7 +3,7 @@
3
3
  * Test zen-direction-flip()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-direction-flip {
9
9
  /* Test zen-direction-flip(left) */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-item-width()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-grid-item-width {
9
9
  /* Test zen-grid-item-width(1) with default $zen-column-count: 1 */
@@ -3,7 +3,7 @@
3
3
  * Test zen-half-gutter()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-half-gutter {
9
9
  /* Test zen-half-gutter() with default $zen-gutter-width: 20px */
@@ -3,7 +3,7 @@
3
3
  * Test zen-unit-width()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-unit-width {
9
9
  /* Test zen-unit-width() with default $zen-column-count: 1 */
@@ -3,7 +3,7 @@
3
3
  * Test zen-clear()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-clear {
9
9
  /* Test zen-clear() */
@@ -3,7 +3,7 @@
3
3
  * Test zen-float()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids/flow";
7
7
 
8
8
  #test-zen-float {
9
9
  /* Test zen-float() */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-background()
4
4
  */
5
5
 
6
- @import "zen/background";
6
+ @import "zen-grids/background";
7
7
 
8
8
  #test-zen-grid-background {
9
9
  /* Test zen-grid-background() with 1 column grid and 20px gutter */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-container()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-grid-container {
9
9
  /* Test zen-grid-container() */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-flow-item()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids/flow";
7
7
 
8
8
  #test-zen-grid-flow-item {
9
9
  /* Test zen-grid-flow-item(1) without setting $column-count */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-item-base()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-grid-item-base {
9
9
  /* Test zen-grid-item-base() */
@@ -3,7 +3,7 @@
3
3
  * Test zen-grid-item()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-grid-item {
9
9
  /* Test zen-grid-item(6, 4) with 12 column grid and 20px gutter */
@@ -3,7 +3,7 @@
3
3
  * Test zen-nested-container()
4
4
  */
5
5
 
6
- @import "zen";
6
+ @import "zen-grids";
7
7
 
8
8
  #test-zen-nested-container {
9
9
  /* Test zen-nested-container() */
@@ -7,7 +7,7 @@
7
7
  float: left;
8
8
  width: 50%;
9
9
  margin-left: 25%;
10
- margin-right: -75%;
10
+ margin-right: -100%;
11
11
  padding-left: 10px;
12
12
  padding-right: 10px;
13
13
  -moz-box-sizing: border-box;
@@ -50,10 +50,10 @@
50
50
  float: left;
51
51
  width: 60%;
52
52
  margin-left: 30%;
53
- margin-right: -90%;
53
+ margin-right: -100%;
54
54
  /* Test zen-grid-item(3, 3) with $zen-grid-width: 1000px, 5 column grid and 40px gutter */
55
55
  float: left;
56
56
  width: 600px;
57
57
  margin-left: 400px;
58
- margin-right: -1000px;
58
+ margin-right: -100%;
59
59
  }
data/zen-grids.gemspec CHANGED
@@ -7,24 +7,25 @@ Gem::Specification.new do |s|
7
7
  s.description = %q{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.}
8
8
 
9
9
  s.homepage = 'http://zengrids.com'
10
- s.license = 'GPL-2'
11
10
  s.rubyforge_project =
12
11
 
13
- s.version = '1.5'
14
- s.date = '2015-09-04'
12
+ s.version = '2.0.0.alpha.1'
13
+ s.date = '2013-02-19'
15
14
 
16
15
  s.authors = ['John Albin Wilkins']
17
16
  s.email = 'virtually.johnalbin@gmail.com'
18
17
 
19
- s.add_runtime_dependency('sass', '>= 3.1', '< 3.4')
18
+ s.add_runtime_dependency('sass', ">= 3.1")
20
19
 
21
20
  s.files = %w[
21
+ component.json
22
22
  LICENSE.txt
23
23
  README.txt
24
24
  lib/zen-grids.rb
25
- stylesheets/_zen.scss
26
- stylesheets/zen/_background.scss
27
- stylesheets/zen/_grids.scss
25
+ _zen-grids.scss
26
+ zen-grids/_background.scss
27
+ zen-grids/_flow.scss
28
+ zen-grids/_grids.scss
28
29
  templates/project/_init.scss
29
30
  templates/project/_layout.scss
30
31
  templates/project/_modules.scss
@@ -78,7 +78,6 @@ $zen-grid-number-images : () !default;
78
78
  $grid-width : $zen-grid-width,
79
79
  $grid-color : $zen-grid-color,
80
80
  $grid-numbers : $zen-grid-numbers,
81
- $float-direction : $zen-float-direction,
82
81
  $reverse-all-floats : $zen-reverse-all-floats
83
82
  ) {
84
83
 
@@ -98,7 +97,7 @@ $zen-grid-number-images : () !default;
98
97
  $half-unit-width : zen-unit-width(2 * $column-count, $grid-width);
99
98
 
100
99
  // Determine the float direction.
101
- $dir : $float-direction;
100
+ $dir : left;
102
101
  @if $reverse-all-floats {
103
102
  $dir : zen-direction-flip($dir);
104
103
  }
@@ -0,0 +1,121 @@
1
+ @import "grids";
2
+
3
+ //
4
+ // Mixins for the Zen Grids system.
5
+ //
6
+
7
+ // @see http://zengrids.com/help/#zen-auto-include-item-base
8
+ $zen-auto-include-flow-item-base : true !default;
9
+
10
+
11
+ //
12
+ // Apply this to an HTML item that is in the normal flow of a document to help
13
+ // align it to the grid. @see http://zengrids.com/help/#zen-float
14
+ //
15
+ @mixin zen-grid-flow-item(
16
+ $column-span,
17
+ $parent-column-count : false,
18
+ $alpha-gutter : false,
19
+ $omega-gutter : true,
20
+ $flow-direction : $zen-float-direction,
21
+ $column-count : $zen-column-count,
22
+ $gutter-width : $zen-gutter-width,
23
+ $grid-width : $zen-grid-width,
24
+ $box-sizing : $zen-box-sizing,
25
+ $reverse-all-flows : $zen-reverse-all-floats,
26
+ $auto-include-flow-item-base : $zen-auto-include-flow-item-base
27
+ ) {
28
+
29
+ $columns: $column-count;
30
+ @if unit($grid-width) == "%" {
31
+ @if $parent-column-count == false {
32
+ @warn "For responsive layouts with a percentage-based grid width, you must set the $parent-column-count to the number of columns that the parent element spans.";
33
+ }
34
+ @else {
35
+ $columns: $parent-column-count;
36
+ }
37
+ }
38
+
39
+ $dir: $flow-direction;
40
+ @if $reverse-all-flows {
41
+ $dir: zen-direction-flip($dir);
42
+ }
43
+ $rev: zen-direction-flip($dir);
44
+
45
+ // Auto-apply the unit base mixin.
46
+ @if $auto-include-flow-item-base {
47
+ @include zen-grid-item-base($gutter-width, $box-sizing);
48
+ }
49
+
50
+ // Calculate the item's width.
51
+ $width: zen-grid-item-width($column-span, $columns, $gutter-width, $grid-width, $box-sizing);
52
+
53
+ @if unit($grid-width) == "%" {
54
+ // Our percentage $width is off if the parent has $gutter-width padding.
55
+ // Calculate an adjusted gutter to fix the width.
56
+ $adjusted-gutter: ($columns - $column-span) * $gutter-width / $columns;
57
+
58
+ width: $width;
59
+
60
+ // Ensure the HTML item either has a full gutter or no gutter on each side.
61
+ padding-#{$dir}: 0;
62
+ @if $alpha-gutter {
63
+ margin-#{$dir}: $gutter-width;
64
+ }
65
+ padding-#{$rev}: $adjusted-gutter;
66
+ @if $omega-gutter {
67
+ margin-#{$rev}: $gutter-width - $adjusted-gutter;
68
+ }
69
+ @else {
70
+ margin-#{$rev}: -($adjusted-gutter);
71
+ }
72
+ }
73
+ @else {
74
+ @if $alpha-gutter and $omega-gutter {
75
+ width: $width;
76
+ @if $gutter-width != 0 {
77
+ margin: {
78
+ #{$dir}: zen-half-gutter($gutter-width, left, $dir);
79
+ #{$rev}: zen-half-gutter($gutter-width, right, $dir);
80
+ }
81
+ }
82
+ }
83
+ @else if not $alpha-gutter and not $omega-gutter {
84
+ width: if($box-sizing == border-box, ($width - $gutter-width), $width);
85
+ @if $gutter-width != 0 {
86
+ padding: {
87
+ left: 0;
88
+ right: 0;
89
+ }
90
+ }
91
+ }
92
+ @else {
93
+ width: $width;
94
+ @if $omega-gutter {
95
+ padding-#{$dir}: 0;
96
+ padding-#{$rev}: $gutter-width;
97
+ }
98
+ @else {
99
+ padding-#{$dir}: $gutter-width;
100
+ padding-#{$rev}: 0;
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ //
107
+ // Apply this to flow items that need to be floated.
108
+ // @see http://zengrids.com/help/#zen-float
109
+ //
110
+ @mixin zen-float(
111
+ $float-direction : $zen-float-direction,
112
+ $reverse-all-floats : $zen-reverse-all-floats
113
+ ) {
114
+ // Determine the float direction.
115
+ $dir: $float-direction;
116
+ @if $reverse-all-floats {
117
+ $dir: zen-direction-flip($dir);
118
+ }
119
+ float: $dir;
120
+ }
121
+