singularitygs 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/singularitygs.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  require 'compass'
2
2
  require 'modular-scale'
3
+ require 'breakpoint'
3
4
 
4
5
  Compass::Frameworks.register("singularitygs", :path => "#{File.dirname(__FILE__)}/..")
5
6
 
6
- module CompassExtension
7
-
8
- VERSION = "0.0.9"
9
- DATE = "2012-07-26"
10
-
7
+ module SingularityGS
8
+ VERSION = "0.0.10"
9
+ DATE = "2012-08-06"
11
10
  end
@@ -1,6 +1,7 @@
1
1
  /*! SINGULARITY -- http://singularity.gs/ */
2
2
  @import compass
3
3
  @import modular-scale
4
+ @import breakpoint
4
5
 
5
6
  // Can be a number or a list of non-uniform column widths
6
7
  $columns: 12 !default
@@ -15,10 +16,7 @@ $padding: 0 !default
15
16
  @import singularitygs/helpers
16
17
 
17
18
  // Compound grid calculation function
18
- @import singularitygs/compound
19
-
20
- // Ratio grid calculation function
21
- @import singularitygs/ratio
19
+ @import singularitygs/grid-plugins
22
20
 
23
21
  // Column math is isolated
24
22
  @import singularitygs/column
@@ -36,4 +34,7 @@ $padding: 0 !default
36
34
  @import singularitygs/grid-test
37
35
 
38
36
  // Mixins to write
39
- @import singularitygs/background-grid
37
+ @import singularitygs/background-grid
38
+
39
+ // Gridsets
40
+ @import singularitygs/gridsets
@@ -0,0 +1,2 @@
1
+ @import grid-plugins/compound
2
+ @import grid-plugins/ratio
@@ -0,0 +1,242 @@
1
+ $gridset: () !default;
2
+ $gutterset: () !default;
3
+ $paddingset: () !default;
4
+
5
+ $gridset-mobile-first: true;
6
+
7
+ @mixin gridset-span($span, $location, $gutters: false, $paddings: false) {
8
+ $length: length($gridset);
9
+
10
+ $query-min: breakpoint-get-context('min-width');
11
+ $query-max: breakpoint-get-context('max-width');
12
+
13
+ @if $query-min {
14
+ $query-min: breakpoint-to-base-em($query-min);
15
+ }
16
+ @if $query-max {
17
+ $query-max: breakpoint-to-base-em($query-max);
18
+ }
19
+
20
+ $written: false;
21
+
22
+ $gutter-length: length($gutterset);
23
+ $padding-length: length($paddingset);
24
+
25
+ $ghr: () !default;
26
+ $ghs: () !default;
27
+ $phs: () !default;
28
+
29
+ @if $query-min or $query-max {
30
+ @for $j from 2 through $length {
31
+ $ghr: append($ghr, nth($gridset, $j), comma);
32
+ }
33
+
34
+ @for $j from 2 through $length {
35
+ @if $j > $gutter-length {
36
+ $ghs: append($ghs, nth($gutterset, $gutter-length));
37
+ }
38
+ @else {
39
+ $ghs: append($ghs, nth($gutterset, $j));
40
+ }
41
+ }
42
+
43
+ @for $j from 2 through $length {
44
+ @if $j > $padding-length {
45
+ $phs: append($phs, nth($paddingset, $padding-length));
46
+ }
47
+ @else {
48
+ $phs: append($phs, nth($paddingset, $j));
49
+ }
50
+ }
51
+
52
+ $ghr: reverse($ghr);
53
+
54
+ $gthr: reverse($ghs);
55
+ $phr: reverse($phs);
56
+
57
+ $holder-length: length($ghr);
58
+
59
+ @for $i from 1 through $holder-length {
60
+ $gridholder: nth($ghr, $i);
61
+
62
+ $grid-columns: nth($gridholder, 1);
63
+ $grid-query: nth($gridholder, 2);
64
+
65
+ $grid-query: breakpoint-to-base-em($grid-query);
66
+
67
+ @if length($gridholder) < 2 {
68
+ @warn 'Grid #{$gridholder} needs a breakpoint value!';
69
+ }
70
+ @else if not $written {
71
+ @if $gridset-mobile-first {
72
+ @if $query-min and not $query-max {
73
+ @if $query-min and $query-max {
74
+ @if $query-min >= $grid-query and $query-max < $grid-query {
75
+ @if $gutters == false {
76
+ @if $gutter-length > 0 {
77
+ $gutters: nth($gthr, $i);
78
+ }
79
+ @else {
80
+ $gutters: $gutter;
81
+ }
82
+ }
83
+ @if $paddings == false {
84
+ @if $padding-length > 0 {
85
+ $paddings: nth($phr, $i);
86
+ }
87
+ @else {
88
+ $paddings: $padding;
89
+ }
90
+ }
91
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
92
+ $written: true;
93
+ $gutters: false;
94
+ $paddings: false;
95
+ }
96
+ }
97
+ @else if $query-min >= $grid-query {
98
+ @if $gutters == false {
99
+ @if $gutter-length > 0 {
100
+ $gutters: nth($gthr, $i);
101
+ }
102
+ @else {
103
+ $gutters: $gutter;
104
+ }
105
+ }
106
+ @if $paddings == false {
107
+ @if $padding-length > 0 {
108
+ $paddings: nth($phr, $i);
109
+ }
110
+ @else {
111
+ $paddings: $padding;
112
+ }
113
+ }
114
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
115
+ $written: true;
116
+ $gutters: false;
117
+ $paddings: false;
118
+ }
119
+ }
120
+ @else {
121
+ @if $query-max < $grid-query {
122
+ @if $gutters == false {
123
+ @if $gutter-length > 0 {
124
+ $gutters: nth($gthr, $i);
125
+ }
126
+ @else {
127
+ $gutters: $gutter;
128
+ }
129
+ }
130
+ @if $paddings == false {
131
+ @if $padding-length > 0 {
132
+ $paddings: nth($phr, $i);
133
+ }
134
+ @else {
135
+ $paddings: $padding;
136
+ }
137
+ }
138
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
139
+ $written: true;
140
+ $gutters: false;
141
+ $paddings: false;
142
+ }
143
+ }
144
+ }
145
+ @else {
146
+ @if $query-min and $query-max {
147
+ @if $gutters == false {
148
+ @if $gutter-length > 0 {
149
+ $gutters: nth($gthr, $i);
150
+ }
151
+ @else {
152
+ $gutters: $gutter;
153
+ }
154
+ }
155
+ @if $paddings == false {
156
+ @if $padding-length > 0 {
157
+ $paddings: nth($phr, $i);
158
+ }
159
+ @else {
160
+ $paddings: $padding;
161
+ }
162
+ }
163
+ @if $query-min > $grid-query and $query-max <= $grid-query {
164
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
165
+ $written: true;
166
+ $gutters: false;
167
+ $paddings: false;
168
+ }
169
+ }
170
+ @else if $query-min and not $query-max {
171
+ @if $query-min > $grid-query {
172
+ @if $gutters == false {
173
+ @if $gutter-length > 0 {
174
+ $gutters: nth($gthr, $i);
175
+ }
176
+ @else {
177
+ $gutters: $gutter;
178
+ }
179
+ }
180
+ @if $paddings == false {
181
+ @if $padding-length > 0 {
182
+ $paddings: nth($phr, $i);
183
+ }
184
+ @else {
185
+ $paddings: $padding;
186
+ }
187
+ }
188
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
189
+ $written: true;
190
+ $gutters: false;
191
+ $paddings: false;
192
+ }
193
+ }
194
+ @else {
195
+ @if $query-max <= $grid-query {
196
+ @if $gutters == false {
197
+ @if $gutter-length > 0 {
198
+ $gutters: nth($gthr, $i);
199
+ }
200
+ @else {
201
+ $gutters: $gutter;
202
+ }
203
+ }
204
+ @if $paddings == false {
205
+ @if $padding-length > 0 {
206
+ $paddings: nth($phr, $i);
207
+ }
208
+ @else {
209
+ $paddings: $padding;
210
+ }
211
+ }
212
+ @include grid-span($span, $location, $grid-columns, $gutters, $paddings);
213
+ $written: true;
214
+ $gutters: false;
215
+ $paddings: false;
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ @else {
223
+ @if $gutters == false {
224
+ @if $gutter-length > 0 {
225
+ $gutters: nth($gutterset, 1);
226
+ }
227
+ @else {
228
+ $gutters: $gutter;
229
+ }
230
+ }
231
+
232
+ @if $paddings == false {
233
+ @if $padding-length > 0 {
234
+ $paddings: nth($paddingset, 1);
235
+ }
236
+ @else {
237
+ $paddings: $padding;
238
+ }
239
+ }
240
+ @include grid-span($span, $location, nth($gridset, 1), $gutters, $paddings);
241
+ }
242
+ }
@@ -2,10 +2,13 @@
2
2
  $grid-counter: 1
3
3
 
4
4
  =grid-span($span, $location: $grid-counter, $columns: $columns, $gutter: $gutter, $padding: $padding)
5
- float: left
5
+ @if $location < column-count($columns)
6
+ float: left
7
+ @else
8
+ float: right
6
9
  width: grid-span($span, $location, $columns, $gutter)
7
10
  $box-sizing: false
8
-
11
+
9
12
  // add special left padding
10
13
  @if type-of($columns) == list
11
14
  @if type-of(nth($columns, $location)) == list
@@ -21,14 +24,14 @@ $grid-counter: 1
21
24
  @else if $padding != 0
22
25
  padding-right: $padding
23
26
  $box-sizing: true
24
-
27
+
25
28
  @else if $padding != 0
26
29
  padding: 0 $padding
27
30
  $box-sizing: true
28
-
31
+
29
32
  @if $box-sizing
30
33
  +box-sizing(border-box)
31
-
34
+
32
35
  // bump up the counter
33
36
  $grid-counter: $location + $span
34
37
  @if $grid-counter > column-count($columns)
@@ -46,7 +49,7 @@ $grid-counter: 1
46
49
  float: left
47
50
  +grid-padding($padding)
48
51
  margin-right: $gutter
49
-
52
+
50
53
  @for $i from 1 through column-count($columns)
51
54
  @for $n from $count + 1 through column-count($columns)
52
55
  #{$selector}#{$prefix}#{$count}-#{$n}
metadata CHANGED
@@ -1,108 +1,135 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: singularitygs
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.9
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 10
9
+ version: 0.0.10
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Scott Kellum
9
13
  - Sam Richard
10
14
  autorequire:
11
15
  bindir: bin
12
16
  cert_chain: []
13
- date: 2012-07-26 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-08-06 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: sass
17
- requirement: !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: 3.2.0.alpha.269
23
- type: :runtime
24
23
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 3
30
+ - 2
31
+ - 0
32
+ - alpha
33
+ - 269
30
34
  version: 3.2.0.alpha.269
31
- - !ruby/object:Gem::Dependency
32
- name: compass
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: 0.12.1
39
35
  type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: compass
40
39
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 0
46
+ - 12
47
+ - 1
46
48
  version: 0.12.1
47
- - !ruby/object:Gem::Dependency
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
48
52
  name: modular-scale
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 1
60
+ - 0
61
+ - 0
54
62
  version: 1.0.0
55
63
  type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: breakpoint
56
67
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: 1.0.0
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 1
74
+ - 1
75
+ - 1
76
+ version: 1.1.1
77
+ type: :runtime
78
+ version_requirements: *id004
63
79
  description: Advanced responsive grid system for Sass and Compass
64
- email:
80
+ email:
65
81
  - scott@scottkellum.com
66
82
  - snugug@gmail.com
67
83
  executables: []
84
+
68
85
  extensions: []
86
+
69
87
  extra_rdoc_files: []
70
- files:
88
+
89
+ files:
71
90
  - lib/singularitygs.rb
72
91
  - stylesheets/singularitygs.sass
73
92
  - stylesheets/singularitygs/_background-grid.sass
74
93
  - stylesheets/singularitygs/_column.sass
75
- - stylesheets/singularitygs/_compound.sass
94
+ - stylesheets/singularitygs/_grid-plugins.sass
76
95
  - stylesheets/singularitygs/_grid-test.sass
77
96
  - stylesheets/singularitygs/_grid.sass
97
+ - stylesheets/singularitygs/_gridsets.scss
78
98
  - stylesheets/singularitygs/_gutter.sass
79
99
  - stylesheets/singularitygs/_helpers.sass
80
100
  - stylesheets/singularitygs/_mixins.sass
81
- - stylesheets/singularitygs/_ratio.scss
101
+ - stylesheets/singularitygs/grid-plugins/_compound.sass
102
+ - stylesheets/singularitygs/grid-plugins/_ratio.scss
103
+ has_rdoc: true
82
104
  homepage: http://singularity.gs
83
105
  licenses: []
106
+
84
107
  post_install_message:
85
108
  rdoc_options: []
86
- require_paths:
109
+
110
+ require_paths:
87
111
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- required_rubygems_version: !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - ! '>='
98
- - !ruby/object:Gem::Version
99
- version: '1.2'
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ segments:
117
+ - 0
118
+ version: "0"
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ segments:
124
+ - 1
125
+ - 2
126
+ version: "1.2"
100
127
  requirements: []
128
+
101
129
  rubyforge_project: singularitygs
102
- rubygems_version: 1.8.24
130
+ rubygems_version: 1.3.6
103
131
  signing_key:
104
132
  specification_version: 3
105
- summary: Singularity is a fluid grid system that can generate uniform columns as well
106
- as asymmetric and compound grids with tools to write grids as functions, mixins,
107
- or class based objects.
133
+ summary: Singularity is a fluid grid system that can generate uniform columns as well as asymmetric and compound grids with tools to write grids as functions, mixins, or class based objects.
108
134
  test_files: []
135
+