susy 2.0.0.alpha.2 → 2.0.0.alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/lib/susy.rb +0 -10
  3. data/sass/_susy.scss +2 -2
  4. data/sass/susy/_core.scss +3 -3
  5. data/sass/susy/_helpers.scss +2 -3
  6. data/sass/susy/_math.scss +2 -2
  7. data/sass/susy/_settings.scss +4 -39
  8. data/sass/susy/api/_float.scss +2 -2
  9. data/sass/susy/api/_shared.scss +2 -2
  10. data/sass/susy/api/float/_container.scss +9 -5
  11. data/sass/susy/api/float/_end.scss +8 -4
  12. data/sass/susy/api/float/_isolate.scss +7 -3
  13. data/sass/susy/api/float/_span.scss +18 -4
  14. data/sass/susy/api/shared/_container.scss +10 -6
  15. data/sass/susy/api/shared/_grid-background.scss +30 -7
  16. data/sass/susy/api/shared/_margins.scss +9 -5
  17. data/sass/susy/api/shared/_padding.scss +9 -5
  18. data/sass/susy/helpers/_direction.scss +11 -1
  19. data/sass/susy/helpers/_nth.scss +4 -0
  20. data/sass/susy/language/_shared.scss +2 -3
  21. data/sass/susy/language/_susy.scss +5 -4
  22. data/sass/susy/language/shared/_context.scss +10 -9
  23. data/sass/susy/language/shared/_settings.scss +181 -101
  24. data/sass/susy/language/susy/_background.scss +84 -75
  25. data/sass/susy/language/susy/_container.scss +57 -77
  26. data/sass/susy/language/susy/_gallery.scss +46 -67
  27. data/sass/susy/language/susy/_gutters.scss +117 -0
  28. data/sass/susy/language/susy/_isolate.scss +21 -14
  29. data/sass/susy/language/susy/_margins.scss +92 -0
  30. data/sass/susy/language/susy/_padding.scss +68 -0
  31. data/sass/susy/language/susy/_rows.scss +43 -15
  32. data/sass/susy/language/susy/_span.scss +198 -61
  33. data/sass/susy/language/susy1/_settings.scss +13 -23
  34. data/sass/susy/math/_columns.scss +26 -3
  35. data/sass/susy/math/_container.scss +17 -12
  36. data/sass/susy/math/_location.scss +13 -0
  37. metadata +8 -35
  38. data/sass/susy/helpers/_sass-lists.scss +0 -90
  39. data/sass/susy/language/susy/_functions.scss +0 -58
  40. data/sass/susy/language/susy/_math.scss +0 -153
@@ -1,15 +1,15 @@
1
1
  // Susy 1.0 Settings
2
2
  // =================
3
3
 
4
- $total-columns : 12;
5
- $column-width : 4em;
6
- $gutter-width : 1em;
7
- $grid-padding : $gutter-width;
4
+ $total-columns : 12 !default;
5
+ $column-width : if($column-width, $column-width, 4em);
6
+ $gutter-width : 1em !default;
7
+ $grid-padding : $gutter-width !default;
8
8
 
9
- $from-direction : left;
10
- $container-width : false;
9
+ $from-direction : left !default;
10
+ $container-width : false !default;
11
11
 
12
- $container-style : magic;
12
+ $container-style : magic !default;
13
13
 
14
14
  // no translation (yet)
15
15
  // --------------------
@@ -17,15 +17,9 @@ $container-style : magic;
17
17
  // $omega-float : opposite-position($from-direction);
18
18
  // $border-box-sizing : false;
19
19
 
20
- // $breakpoint-media-output : true;
21
- // $breakpoint-ie-output : true;
22
- // $breakpoint-raw-output : false;
23
-
24
- // from compass
25
- // ------------
26
-
27
- $show-column-grid-backgrounds: true;
28
- $show-grid-backgrounds: true;
20
+ // $breakpoint-media-output : true !default;
21
+ // $breakpoint-ie-output : true !default;
22
+ // $breakpoint-raw-output : false !default;
29
23
 
30
24
  // translation mixin
31
25
  // -----------------
@@ -38,20 +32,16 @@ $show-grid-backgrounds: true;
38
32
  $column-width: $column-width;
39
33
  $flow: if($from-direction == right, rtl, ltr);
40
34
 
41
- $isolate: false;
42
- $gutter-placement: after;
43
- $show-grids: $show-grid-backgrounds or $show-column-grid-backgrounds;
44
-
45
35
  @if $container-style == static {
46
- $static: static;
36
+ $layout-math: static;
47
37
  @if $container-width {
48
38
  @warn "For static output, we use your $column-width setting and ignore any $container-width override.";
49
39
  }
50
40
  } @else {
51
- $static: false;
52
- $container: $container-width;
41
+ $layout-math: fluid;
53
42
 
54
43
  @if $container-width {
44
+ $container: $container-width;
55
45
  $column-width: false;
56
46
  } @else if $container-style == fluid and unit($column-width) != '%' {
57
47
  $container: 100%;
@@ -1,7 +1,10 @@
1
1
  // Column math
2
2
  // ===========
3
3
 
4
- // Returns true if a grid is symmetrical
4
+ // Is Symmetrical
5
+ // --------------
6
+ // Returns true if a grid is symmetrical.
7
+ // - [$columns] : <number> | <list>
5
8
  @function is-symmetrical(
6
9
  $columns: $columns
7
10
  ) {
@@ -12,7 +15,10 @@
12
15
  }
13
16
  }
14
17
 
18
+ // Columns Count
19
+ // -------------
15
20
  // Find the number of columns in a given layout
21
+ // - [$columns] : <number> | <list>
16
22
  @function column-count(
17
23
  $columns: $columns
18
24
  ) {
@@ -25,7 +31,12 @@
25
31
  @return $count;
26
32
  }
27
33
 
34
+ // Column Sum
35
+ // ----------
28
36
  // Find the total sum of column-units in a layout
37
+ // - [$columns] : <number> | <list>
38
+ // - [$gutters] : <ratio>
39
+ // - [$outer] : <boolean>
29
40
  @function column-sum(
30
41
  $columns : $columns,
31
42
  $gutters : $gutters,
@@ -51,7 +62,12 @@
51
62
  @return $column-sum + $gutter-sum;
52
63
  }
53
64
 
54
- // Return a subset of columns at a given location
65
+ // Get Columns
66
+ // -----------
67
+ // Return a subset of columns at a given location.
68
+ // - $span : <number>
69
+ // - $location : first | last | <number>
70
+ // - [$columns] : <number> | <list>
55
71
  @function get-columns(
56
72
  $span,
57
73
  $location,
@@ -73,7 +89,14 @@
73
89
  @return $sub-columns;
74
90
  }
75
91
 
76
- // Find the sum of a column-span
92
+ // Get Column Span Sum
93
+ // -------------------
94
+ // Find the sum of a column-span.
95
+ // - $span : <number>
96
+ // - $location : first | last | <number>
97
+ // - [$columns] : <number> | <list>
98
+ // - [$gutters] : <ratio>
99
+ // - [$outer] : <boolean>
77
100
  @function get-column-span-sum(
78
101
  $span,
79
102
  $location : false,
@@ -1,7 +1,10 @@
1
1
  // Container math
2
2
  // ==============
3
3
 
4
- // Parse the $container-position into margin values
4
+ // Parse Container Position
5
+ // ------------------------
6
+ // Parse the $container-position into margin values.
7
+ // - [$justify] : left | center | right | <length> [<length>]
5
8
  @function parse-container-position(
6
9
  $justify: $container-position
7
10
  ) {
@@ -11,35 +14,37 @@
11
14
  @if type-of($justify) == list {
12
15
  $left: nth($justify,1);
13
16
  $right: nth($justify,2);
14
- } @else if type-of($justify) == number and not unitless($justify) {
15
- $left: $justify;
16
- $right: $justify;
17
17
  } @else if $justify == left {
18
18
  $left: 0;
19
+ $right: auto;
19
20
  } @else if $justify == right {
21
+ $left: auto;
20
22
  $right: 0;
21
23
  } @else if $justify == center {
22
24
  $left: auto;
23
25
  $right: auto;
26
+ } @else {
27
+ $left: $justify;
28
+ $right: $justify;
24
29
  }
25
30
 
26
31
  @return $left $right;
27
32
  }
28
33
 
29
- // Calculate the width of a container based on columns and gutters
34
+ // Calculate Container Width
35
+ // -------------------------
36
+ // Calculate the width of a container based on columns and gutters.
37
+ // - [$columns] : <number> | <list>
38
+ // - [$gutters] : <ratio>
39
+ // - [$column-width] : <length>
40
+ // - [$outer] : <boolean>
30
41
  @function calculate-container-width(
31
42
  $columns : $columns,
32
43
  $gutters : $gutters,
33
44
  $column-width : $column-width,
34
45
  $outer : false
35
46
  ) {
36
- $width: null;
37
-
38
- @if $column-width {
39
- $width: column-sum($columns, $gutters, $outer) * $column-width;
40
- } @else {
41
- @warn "We need either `$column-width` or `$container` in order to create your container.";
42
- }
47
+ $width: column-sum($columns, $gutters, $outer) * $column-width;
43
48
 
44
49
  @return $width;
45
50
  }
@@ -1,7 +1,12 @@
1
1
  // Location math
2
2
  // =============
3
3
 
4
+ // Is Last
5
+ // -------
4
6
  // Find if a span covers the last columns
7
+ // - $span : <number>
8
+ // - $location : first | last | <number>
9
+ // - [$columns] : <number> | <list>
5
10
  @function is-last(
6
11
  $span,
7
12
  $location,
@@ -18,7 +23,10 @@
18
23
  @return $is-last;
19
24
  }
20
25
 
26
+ // Is First
27
+ // --------
21
28
  // Find if a span covers the first columns
29
+ // - $location : first | last | <number>
22
30
  @function is-first(
23
31
  $location
24
32
  ) {
@@ -29,7 +37,12 @@
29
37
  }
30
38
  }
31
39
 
40
+ // Get Location Position
41
+ // ---------------------
32
42
  // Return a numeric location, even if a first/last keyword is used
43
+ // - $span : <number>
44
+ // - $location : first | last | <number>
45
+ // - [$columns] : <number> | <list>
33
46
  @function get-location-position(
34
47
  $span,
35
48
  $location,
metadata CHANGED
@@ -1,15 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: susy
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1173656864
5
- prerelease: 6
6
- segments:
7
- - 2
8
- - 0
9
- - 0
10
- - alpha
11
- - 2
12
- version: 2.0.0.alpha.2
4
+ version: 2.0.0.alpha.3
13
5
  platform: ruby
14
6
  authors:
15
7
  - Eric Meyer
@@ -24,21 +16,15 @@ autorequire:
24
16
  bindir: bin
25
17
  cert_chain: []
26
18
 
27
- date: 2013-05-03 00:00:00 Z
19
+ date: 2013-07-09 00:00:00 Z
28
20
  dependencies:
29
21
  - !ruby/object:Gem::Dependency
30
22
  name: compass
31
23
  prerelease: false
32
24
  requirement: &id001 !ruby/object:Gem::Requirement
33
- none: false
34
25
  requirements:
35
26
  - - ">="
36
27
  - !ruby/object:Gem::Version
37
- hash: 43
38
- segments:
39
- - 0
40
- - 12
41
- - 2
42
28
  version: 0.12.2
43
29
  type: :runtime
44
30
  version_requirements: *id001
@@ -46,15 +32,9 @@ dependencies:
46
32
  name: sass
47
33
  prerelease: false
48
34
  requirement: &id002 !ruby/object:Gem::Requirement
49
- none: false
50
35
  requirements:
51
36
  - - ">="
52
37
  - !ruby/object:Gem::Version
53
- hash: 15
54
- segments:
55
- - 3
56
- - 2
57
- - 0
58
38
  version: 3.2.0
59
39
  type: :runtime
60
40
  version_requirements: *id002
@@ -96,7 +76,6 @@ files:
96
76
  - sass/susy/api/shared/_padding.scss
97
77
  - sass/susy/helpers/_direction.scss
98
78
  - sass/susy/helpers/_nth.scss
99
- - sass/susy/helpers/_sass-lists.scss
100
79
  - sass/susy/language/_shared.scss
101
80
  - sass/susy/language/_susy.scss
102
81
  - sass/susy/language/_susy1.scss
@@ -104,10 +83,11 @@ files:
104
83
  - sass/susy/language/shared/_settings.scss
105
84
  - sass/susy/language/susy/_background.scss
106
85
  - sass/susy/language/susy/_container.scss
107
- - sass/susy/language/susy/_functions.scss
108
86
  - sass/susy/language/susy/_gallery.scss
87
+ - sass/susy/language/susy/_gutters.scss
109
88
  - sass/susy/language/susy/_isolate.scss
110
- - sass/susy/language/susy/_math.scss
89
+ - sass/susy/language/susy/_margins.scss
90
+ - sass/susy/language/susy/_padding.scss
111
91
  - sass/susy/language/susy/_rows.scss
112
92
  - sass/susy/language/susy/_span.scss
113
93
  - sass/susy/language/susy1/_settings.scss
@@ -248,6 +228,8 @@ files:
248
228
  homepage: http://susy.oddbird.net/
249
229
  licenses: []
250
230
 
231
+ metadata: {}
232
+
251
233
  post_install_message:
252
234
  rdoc_options:
253
235
  - --line-numbers
@@ -259,28 +241,19 @@ rdoc_options:
259
241
  require_paths:
260
242
  - lib
261
243
  required_ruby_version: !ruby/object:Gem::Requirement
262
- none: false
263
244
  requirements:
264
245
  - - ">="
265
246
  - !ruby/object:Gem::Version
266
- hash: 3
267
- segments:
268
- - 0
269
247
  version: "0"
270
248
  required_rubygems_version: !ruby/object:Gem::Requirement
271
- none: false
272
249
  requirements:
273
250
  - - ">="
274
251
  - !ruby/object:Gem::Version
275
- hash: 11
276
- segments:
277
- - 1
278
- - 2
279
252
  version: "1.2"
280
253
  requirements: []
281
254
 
282
255
  rubyforge_project: susy
283
- rubygems_version: 1.8.24
256
+ rubygems_version: 2.0.3
284
257
  signing_key:
285
258
  specification_version: 3
286
259
  summary: Responsive grids for Sass & Compass.
@@ -1,90 +0,0 @@
1
- // List helpers
2
- // ============
3
-
4
- // Return the sum of all items in a list.
5
- @function list-sum(
6
- $list
7
- ) {
8
- $sum: 0;
9
-
10
- @each $item in $list {
11
- $sum: $sum + $item;
12
- }
13
-
14
- @return $sum;
15
- }
16
-
17
- // Return list of index locations where a query appears in a list,
18
- // including unit queries.
19
- @function query-list(
20
- $list,
21
- $query,
22
- $mode: none
23
- ) {
24
- $return: ();
25
-
26
- @for $i from 1 through length($list) {
27
- @if $mode == unit {
28
- @if unit(nth($list, $i)) == $query {
29
- $return: append($return, $i);
30
- }
31
- }
32
- @else {
33
- @if nth(nth($list, $i), 1) == $query {
34
- $return: append($return, $i);
35
- }
36
- }
37
- }
38
-
39
- @if $return == () {
40
- $return: false;
41
- }
42
-
43
- @return $return;
44
- }
45
-
46
- // Reverses direction of a list
47
- @function reverse(
48
- $list
49
- ) {
50
- $length: length($list);
51
- $return: ();
52
-
53
- @for $i from 0 to $length {
54
- $return: append($return, nth($list, $length - $i), comma);
55
- }
56
-
57
- @return $return;
58
- }
59
-
60
- // Return a list with specific items removed
61
- @function filter(
62
- $list,
63
- $target
64
- ) {
65
- $clean: compact();
66
-
67
- @if index($list, $target) {
68
- @each $item in $list {
69
- $clean: if($item == $target, $clean, append($clean, $item));
70
- }
71
- } @else {
72
- $clean: $list;
73
- }
74
-
75
- @return $clean;
76
- }
77
-
78
- @function nth-filter(
79
- $list,
80
- $index
81
- ) {
82
- $clean: compact();
83
-
84
- @each $item in $list {
85
- $clean: if(index($list, $item) == $index, $clean, append($clean, $item));
86
- }
87
-
88
- @return $clean;
89
- }
90
-
@@ -1,58 +0,0 @@
1
- // Math Functions
2
- // ==============
3
-
4
- // Return the width of a span
5
- @function span(
6
- $span: 1
7
- ) {
8
- $span : parse-span($span);
9
-
10
- $width : get-span-setting(span, $span);
11
-
12
- $this-location : get-span-setting(location, $span);
13
- $this-columns : get-span-setting(columns, $span);
14
- $this-gutters : get-span-setting(gutters, $span);
15
- $this-column-width : get-span-setting(column-width, $span);
16
- $this-static : get-span-setting(static, $span);
17
-
18
- $this-location : if($this-location, $this-location, 1);
19
- $this-columns : if($this-columns, $this-columns, $columns);
20
- $this-gutters : if($this-gutters, $this-gutters, $gutters);
21
- $this-column-width : if($this-column-width, $this-column-width, $column-width);
22
- $this-static : if($this-static, $this-static, $static);
23
-
24
- $width: get-span-width($width, $this-location, $this-columns, $this-gutters, $this-column-width, $this-static);
25
-
26
- @return $width;
27
- }
28
-
29
- // Return the width of a gutter
30
- @function gutter(
31
- $context: get-grid()
32
- ) {
33
- $context : parse-grid($context);
34
-
35
- $this-columns : get-setting(columns, $context);
36
- $this-gutters : get-setting(gutters, $context);
37
- $this-column-width : get-setting(column-width, $context);
38
- $this-static : get-setting(static, $context);
39
-
40
- $this-columns : if($this-columns, $this-columns, $columns);
41
- $this-gutters : if($this-gutters, $this-gutters, $gutters);
42
- $this-column-width : if($this-column-width, $this-column-width, $column-width);
43
- $this-static : if($this-static, $this-static, $static);
44
-
45
- $width: get-gutter-width($this-columns, $this-gutters, $this-column-width, $this-static);
46
-
47
- @return $width;
48
- }
49
-
50
- // Return the width of a span, plus any attached gutters
51
- @function outer-span(
52
- $span: 1
53
- ) {
54
- $width : span($span);
55
- $gutter : gutter($span);
56
-
57
- @return $width + $gutter;
58
- }