grid-coordinates 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.mdown CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Grid Coordinates is a [Sass](http://sass-lang.com/) CSS Grid Framework Generator delivered as a [Compass](http://compass-style.org/) extension. This project was inspired by Tyler Tate's [1kb CSS Grid](http://1kbgrid.com/) project.
4
4
 
5
- Grid Coordinates is quite simple. It sets up the styles for your CSS grid framework and even supports nested grids as well. It's also able to generate styles for grids of any size - you control the coordinates and it generates the styles.
5
+ Grid Coordinates is quite simple. It fully leverages both classes and extends to set up the styles for your CSS grid framework. Grid Coordinates even supports nested grids and prefix and suffix features. It's also able to generate styles for grids of any size - you control the coordinates and it generates the styles.
6
6
 
7
7
  ## Installation
8
8
 
@@ -12,7 +12,7 @@ Add `require 'grid-coordinates'` to your Compass config file.
12
12
 
13
13
  ## Usage
14
14
 
15
- The default grid-coordinates defaults have been set to create a 960px wide grid with 12 columns at 60px with a gutter of 20px. You can override these as needed in your project if the 960px grid doesn't suit your needs.
15
+ Grid-coordinates defaults to the 960px grid with 12 columns (12 columns at 60px with a gutter of 20px). You can override these variables as needed in your project if this grid doesn't suit your needs.
16
16
 
17
17
  Use [1kbgrid.com](http://1kbgrid.com) or another grid generator for guidance on the various grid coordinates possible.
18
18
 
@@ -20,26 +20,32 @@ See `templates/project/screen.sass` for an example.
20
20
 
21
21
  ### Configure as needed and import
22
22
 
23
- // Configure grid coordinates
24
- $grid-columns: 16
25
- $grid-pixels: 40px
26
- $grid-gutter-width: 20px
23
+ // Configure grid coordinates
24
+ $grid-columns: 12 !default
25
+ $grid-pixels: 60px !default
26
+ $grid-gutter-width: 20px !default
27
27
 
28
28
  @import grid-coordinates
29
+
30
+ @include grid-coordinates
31
+
32
+ ...
33
+
34
+ ### Available extends
29
35
 
30
- ### Available mixins
36
+ Use the extend classes in your HTML or use them to extend in your Sass stylesheets. For an example of this in use, see `templates/project`.
31
37
 
32
- `@include grid-container`
38
+ `@extend .grid-container`
33
39
 
34
- `@include nested-grid-container`
40
+ `@extend .nested-grid-container`
35
41
 
36
- `@include grid($grid-columns)`
42
+ `@extend .grid-4`
37
43
 
38
- `@include grid-prefix($grid-columns)`
44
+ `@extend .grid-prefix-4`
39
45
 
40
- `@include grid-suffix($grid-columns)`
46
+ `@extend .grid-suffix-4`
41
47
 
42
- `@include grid-full`
48
+ `@extend .grid-full`
43
49
 
44
50
  ## License
45
51
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.6
1
+ 1.0.7
@@ -0,0 +1,57 @@
1
+ @import compass/utilities
2
+
3
+ // Configure grid coordinates
4
+ $grid-columns: 12 !default
5
+ $grid-pixels: 60px !default
6
+ $grid-gutter-width: 20px !default
7
+
8
+ @mixin grid-coordinates
9
+ /*
10
+ Grid-Coordinates by Adam Stacoviak
11
+ Fork me: http://adamstac.com/grid-coordinates */
12
+ .grid-container
13
+ margin: 0 auto
14
+ overflow: hidden
15
+ width: ($grid-columns * $grid-pixels) + ($grid-columns * $grid-gutter-width)
16
+ .nested-grid-container
17
+ display: inline-block
18
+ margin:
19
+ left: -$grid-gutter-width / 2
20
+ right: -$grid-gutter-width / 2
21
+ overflow: hidden
22
+ width: auto
23
+ @for $i from 1 through $grid-columns
24
+ .grid-#{$i}
25
+ @include grid($i)
26
+ .grid-full
27
+ @include grid($grid-columns)
28
+ @for $i from 1 through $grid-columns - 1
29
+ .grid-prefix-#{$i}
30
+ @include grid-prefix($i)
31
+ @for $i from 1 through $grid-columns - 1
32
+ .grid-suffix-#{$i}
33
+ @include grid-suffix($i)
34
+
35
+ @mixin grid($grid-columns)
36
+ @include grid-width($grid-columns)
37
+ @include float-left
38
+ margin: 0 $grid-gutter-width / 2
39
+ overflow: hidden
40
+
41
+ @mixin grid-width($grid-columns)
42
+ @if $grid-columns == 1
43
+ width: $grid-pixels
44
+ @else
45
+ width: ($grid-columns * $grid-pixels) + (($grid-columns * $grid-gutter-width) - $grid-gutter-width)
46
+
47
+ @mixin grid-prefix($grid-columns)
48
+ @if $grid-columns == 1
49
+ padding-left: $grid-pixels + $grid-gutter-width
50
+ @else
51
+ padding-left: ($grid-columns * $grid-pixels) + ($grid-columns * $grid-gutter-width)
52
+
53
+ @mixin grid-suffix($grid-columns)
54
+ @if $grid-columns == 1
55
+ padding-right: $grid-pixels + $grid-gutter-width
56
+ @else
57
+ padding-right: ($grid-columns * $grid-pixels) + ($grid-columns * $grid-gutter-width)
@@ -1,48 +1,48 @@
1
1
  @import "compass/utilities";
2
2
 
3
- // How many grid columns would you like?
3
+ // Configure grid coordinates
4
4
  $grid-columns: 12 !default;
5
-
6
- // How many pixels wide would you like each column to be?
7
5
  $grid-pixels: 60px !default;
8
-
9
- // How many pixels wide would you like the gutter to be?
10
6
  $grid-gutter-width: 20px !default;
11
7
 
12
- // Set grid width
13
- $grid-width: $grid-columns * $grid-pixels + $grid-columns * $grid-gutter-width;
8
+ @mixin grid-coordinates {
9
+ /* Grid-Coordinates by Adam Stacoviak
10
+ * Fork me: http://adamstac.com/grid-coordinates */
11
+ .grid-container {
12
+ margin: 0 auto;
13
+ overflow: hidden;
14
+ width: $grid-columns * $grid-pixels + $grid-columns * $grid-gutter-width; }
15
+ .nested-grid-container {
16
+ display: inline-block;
17
+ margin: {
18
+ left: -$grid-gutter-width / 2;
19
+ right: -$grid-gutter-width / 2; };
20
+ overflow: hidden;
21
+ width: auto; }
22
+ @for $i from 1 through $grid-columns {
23
+ .grid-#{$i} {
24
+ @include grid($i); } }
25
+ .grid-full {
26
+ @include grid($grid-columns); }
27
+ @for $i from 1 through $grid-columns - 1 {
28
+ .grid-prefix-#{$i} {
29
+ @include grid-prefix($i); } }
30
+ @for $i from 1 through $grid-columns - 1 {
31
+ .grid-suffix-#{$i} {
32
+ @include grid-suffix($i); } } }
14
33
 
15
34
  @mixin grid($grid-columns) {
16
- @include column;
17
- @include grid-width($grid-columns); }
18
-
19
- // Used internatlly to the extension only
20
- @mixin column {
35
+ @include grid-width($grid-columns);
21
36
  @include float-left;
22
37
  margin: 0 $grid-gutter-width / 2;
23
38
  overflow: hidden; }
24
39
 
25
- // Used internatlly to the extension only
26
40
  @mixin grid-width($grid-columns) {
27
41
  @if $grid-columns == 1 {
28
42
  width: $grid-pixels; }
29
43
  @else {
30
44
  width: $grid-columns * $grid-pixels + $grid-columns * $grid-gutter-width - $grid-gutter-width; } }
31
45
 
32
- // Mixins used to create, define and manipulate the grid
33
- @mixin grid-container {
34
- margin: 0 auto;
35
- overflow: hidden;
36
- width: $grid-width; }
37
-
38
- @mixin nested-grid-container {
39
- display: inline-block;
40
- margin: {
41
- left: -$grid-gutter-width / 2;
42
- right: -$grid-gutter-width / 2; };
43
- overflow: hidden;
44
- width: auto; }
45
-
46
46
  @mixin grid-prefix($grid-columns) {
47
47
  @if $grid-columns == 1 {
48
48
  padding-left: $grid-pixels + $grid-gutter-width; }
@@ -54,6 +54,3 @@ $grid-width: $grid-columns * $grid-pixels + $grid-columns * $grid-gutter-width;
54
54
  padding-right: $grid-pixels + $grid-gutter-width; }
55
55
  @else {
56
56
  padding-right: $grid-columns * $grid-pixels + $grid-columns * $grid-gutter-width; } }
57
-
58
- @mixin grid-full {
59
- @include grid($grid-columns); }
@@ -6,14 +6,18 @@
6
6
  %body{:id => body_id, :class => body_class}
7
7
  #header
8
8
  #brand
9
- %p brand
9
+ .content
10
+ %p brand
10
11
  #nav
11
- %p nav
12
+ .content
13
+ %p nav
12
14
  #page
13
15
  #page-body
14
- %p page-body
16
+ .content
17
+ %p page-body
15
18
  #page-sidebar
16
- %p page-sidebar
19
+ .content
20
+ %p page-sidebar
17
21
  #footer
18
- #footer-body
22
+ .content
19
23
  %p footer
@@ -1,71 +1,279 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ dl, dt, dd, ol, ul, li,
7
+ fieldset, form, label, legend,
8
+ table, caption, tbody, tfoot, thead, tr, th, td {
9
+ margin: 0;
10
+ padding: 0;
11
+ border: 0;
12
+ outline: 0;
13
+ font-weight: inherit;
14
+ font-style: inherit;
15
+ font-size: 100%;
16
+ font-family: inherit;
17
+ vertical-align: baseline;
18
+ }
19
+
20
+ body {
21
+ line-height: 1;
22
+ color: black;
23
+ background: white;
24
+ }
25
+
26
+ ol, ul {
27
+ list-style: none;
28
+ }
29
+
30
+ table {
31
+ border-collapse: separate;
32
+ border-spacing: 0;
33
+ vertical-align: middle;
34
+ }
35
+
36
+ caption, th, td {
37
+ text-align: left;
38
+ font-weight: normal;
39
+ vertical-align: middle;
40
+ }
41
+
42
+ q, blockquote {
43
+ quotes: "" "";
44
+ }
45
+ q:before, q:after, blockquote:before, blockquote:after {
46
+ content: "";
47
+ }
48
+
49
+ a img {
50
+ border: none;
51
+ }
52
+
1
53
  body {
2
54
  font: bold 14px helvetica, arial, sans-serif;
3
55
  padding-top: 20px;
4
56
  }
5
57
 
6
- #header, #page, #footer {
58
+ /* Grid-Coordinates by Adam Stacoviak
59
+ * Fork me: http://adamstac.com/grid-coordinates */
60
+ .grid-container, #header, #page, #footer {
7
61
  margin: 0 auto;
8
62
  overflow: hidden;
9
63
  width: 960px;
10
64
  }
11
65
 
12
- #brand {
66
+ .nested-grid-container {
67
+ display: inline-block;
68
+ margin-left: -10px;
69
+ margin-right: -10px;
70
+ overflow: hidden;
71
+ width: auto;
72
+ }
73
+
74
+ .grid-1 {
75
+ width: 60px;
76
+ display: inline;
77
+ float: left;
78
+ margin: 0 10px;
79
+ overflow: hidden;
80
+ }
81
+
82
+ .grid-2 {
83
+ width: 140px;
13
84
  display: inline;
14
85
  float: left;
15
86
  margin: 0 10px;
16
87
  overflow: hidden;
88
+ }
89
+
90
+ .grid-3, #brand {
91
+ width: 220px;
92
+ display: inline;
93
+ float: left;
94
+ margin: 0 10px;
95
+ overflow: hidden;
96
+ }
97
+
98
+ .grid-4, #page-sidebar {
17
99
  width: 300px;
100
+ display: inline;
101
+ float: left;
102
+ margin: 0 10px;
103
+ overflow: hidden;
18
104
  }
19
105
 
20
- #nav {
106
+ .grid-5 {
107
+ width: 380px;
21
108
  display: inline;
22
109
  float: left;
23
110
  margin: 0 10px;
24
111
  overflow: hidden;
25
- width: 620px;
26
112
  }
27
113
 
28
- #page-body {
114
+ .grid-6 {
115
+ width: 460px;
29
116
  display: inline;
30
117
  float: left;
31
118
  margin: 0 10px;
32
119
  overflow: hidden;
120
+ }
121
+
122
+ .grid-7 {
123
+ width: 540px;
124
+ display: inline;
125
+ float: left;
126
+ margin: 0 10px;
127
+ overflow: hidden;
128
+ }
129
+
130
+ .grid-8, #page-body {
33
131
  width: 620px;
132
+ display: inline;
133
+ float: left;
134
+ margin: 0 10px;
135
+ overflow: hidden;
34
136
  }
35
- #page-body.wide {
137
+
138
+ .grid-9, #nav {
139
+ width: 700px;
36
140
  display: inline;
37
141
  float: left;
38
142
  margin: 0 10px;
39
143
  overflow: hidden;
40
- width: 940px;
41
144
  }
42
145
 
43
- #page-sidebar {
146
+ .grid-10 {
147
+ width: 780px;
148
+ display: inline;
149
+ float: left;
150
+ margin: 0 10px;
151
+ overflow: hidden;
152
+ }
153
+
154
+ .grid-11 {
155
+ width: 860px;
44
156
  display: inline;
45
157
  float: left;
46
158
  margin: 0 10px;
47
159
  overflow: hidden;
48
- width: 300px;
49
160
  }
50
161
 
51
- #footer-body {
162
+ .grid-12 {
163
+ width: 940px;
52
164
  display: inline;
53
165
  float: left;
54
166
  margin: 0 10px;
55
167
  overflow: hidden;
168
+ }
169
+
170
+ .grid-full, #page-body.wide, #footer .content {
56
171
  width: 940px;
172
+ display: inline;
173
+ float: left;
174
+ margin: 0 10px;
175
+ overflow: hidden;
176
+ }
177
+
178
+ .grid-prefix-1 {
179
+ padding-left: 80px;
180
+ }
181
+
182
+ .grid-prefix-2 {
183
+ padding-left: 160px;
184
+ }
185
+
186
+ .grid-prefix-3 {
187
+ padding-left: 240px;
188
+ }
189
+
190
+ .grid-prefix-4 {
191
+ padding-left: 320px;
192
+ }
193
+
194
+ .grid-prefix-5 {
195
+ padding-left: 400px;
196
+ }
197
+
198
+ .grid-prefix-6 {
199
+ padding-left: 480px;
200
+ }
201
+
202
+ .grid-prefix-7 {
203
+ padding-left: 560px;
204
+ }
205
+
206
+ .grid-prefix-8 {
207
+ padding-left: 640px;
208
+ }
209
+
210
+ .grid-prefix-9 {
211
+ padding-left: 720px;
212
+ }
213
+
214
+ .grid-prefix-10 {
215
+ padding-left: 800px;
216
+ }
217
+
218
+ .grid-prefix-11 {
219
+ padding-left: 880px;
220
+ }
221
+
222
+ .grid-suffix-1 {
223
+ padding-right: 80px;
224
+ }
225
+
226
+ .grid-suffix-2 {
227
+ padding-right: 160px;
228
+ }
229
+
230
+ .grid-suffix-3 {
231
+ padding-right: 240px;
232
+ }
233
+
234
+ .grid-suffix-4 {
235
+ padding-right: 320px;
236
+ }
237
+
238
+ .grid-suffix-5 {
239
+ padding-right: 400px;
240
+ }
241
+
242
+ .grid-suffix-6 {
243
+ padding-right: 480px;
244
+ }
245
+
246
+ .grid-suffix-7 {
247
+ padding-right: 560px;
248
+ }
249
+
250
+ .grid-suffix-8 {
251
+ padding-right: 640px;
252
+ }
253
+
254
+ .grid-suffix-9 {
255
+ padding-right: 720px;
256
+ }
257
+
258
+ .grid-suffix-10 {
259
+ padding-right: 800px;
260
+ }
261
+
262
+ .grid-suffix-11 {
263
+ padding-right: 880px;
57
264
  }
58
265
 
59
- .common, #brand, #nav, #footer-body, #page-body, #page-body.wide, #page-sidebar {
60
- background: #dddddd;
266
+ .common, #brand, #nav, #page-body, #page-sidebar, #footer .content {
267
+ background: #444444;
268
+ color: white;
61
269
  margin-bottom: 20px;
62
270
  text-align: center;
63
271
  }
64
272
 
65
- #brand, #nav, #footer-body {
273
+ #brand, #nav, #footer .content {
66
274
  line-height: 100px;
67
275
  }
68
276
 
69
- #page-body, #page-body.wide, #page-sidebar {
277
+ #page-body, #page-sidebar {
70
278
  line-height: 400px;
71
279
  }
@@ -1,45 +1,50 @@
1
- @import compass
2
-
3
- // Configure grid coordinates
4
- $grid-columns: 12
5
- $grid-pixels: 60px
6
- $grid-gutter-width: 20px
7
-
8
- @import grid-coordinates
1
+ @import compass/reset
2
+ @import compass/utilities
9
3
 
10
4
  body
11
5
  font: bold 14px helvetica, arial, sans-serif
12
6
  padding-top: 20px
7
+
8
+ // // Configure grid coordinates
9
+ // $grid-columns: 16
10
+ // $grid-pixels: 40px
11
+ // $grid-gutter-width: 20px
12
+
13
+ @import grid-coordinates
14
+
15
+ @include grid-coordinates
13
16
 
14
17
  #header, #page, #footer
15
- @include grid-container
18
+ @extend .grid-container
16
19
 
17
20
  #brand
18
- @include grid(4)
21
+ @extend .grid-3
19
22
 
20
23
  #nav
21
- @include grid(8)
24
+ @extend .grid-9
22
25
 
23
26
  #page-body
24
- @include grid(8)
27
+ @extend .grid-8
25
28
  &.wide
26
- @include grid-full
29
+ @extend .grid-full
27
30
 
28
31
  #page-sidebar
29
- @include grid(4)
32
+ @extend .grid-4
30
33
 
31
- #footer-body
32
- @include grid-full
34
+ #footer .content
35
+ @extend .grid-full
33
36
 
34
37
  .common
35
- background: #ddd
38
+ background: #444
39
+ color: #fff
36
40
  margin-bottom: 20px
37
41
  text-align: center
38
42
 
39
- #brand, #nav, #footer-body
43
+ #brand, #nav, #page-body, #page-sidebar, #footer .content
40
44
  @extend .common
45
+
46
+ #brand, #nav, #footer .content
41
47
  line-height: 100px
42
48
 
43
49
  #page-body, #page-sidebar
44
- @extend .common
45
50
  line-height: 400px
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid-coordinates
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 6
10
- version: 1.0.6
9
+ - 7
10
+ version: 1.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Stacoviak
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 63
29
+ hash: 61
30
30
  segments:
31
31
  - 0
32
32
  - 10
33
- - 4
34
- version: 0.10.4
33
+ - 5
34
+ version: 0.10.5
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  description: A Sass CSS Grid Framework Generator (Compass Extension) inspired by the 1kb CSS Grid project
@@ -46,6 +46,7 @@ files:
46
46
  - README.mdown
47
47
  - VERSION
48
48
  - lib/grid-coordinates.rb
49
+ - stylesheets/_grid-coordinates.sass
49
50
  - stylesheets/_grid-coordinates.scss
50
51
  - templates/project/index.haml
51
52
  - templates/project/manifest.rb