susy 2.0.0.alpha.4 → 2.0.0.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +7 -7
  2. data/README.md +2 -0
  3. data/VERSION +1 -0
  4. data/lib/compass-susy.rb +1 -0
  5. data/lib/susy.rb +12 -4
  6. data/sass/susy/_helpers.scss +2 -0
  7. data/sass/susy/_settings.scss +7 -20
  8. data/sass/susy/api/_float.scss +2 -0
  9. data/sass/susy/api/float/_container.scss +4 -6
  10. data/sass/susy/api/float/_end.scss +7 -11
  11. data/sass/susy/api/float/_isolate.scss +1 -1
  12. data/sass/susy/api/float/_span.scss +2 -8
  13. data/sass/susy/api/shared/_background.scss +24 -36
  14. data/sass/susy/api/shared/_container.scss +7 -13
  15. data/sass/susy/api/shared/_margins.scss +1 -1
  16. data/sass/susy/api/shared/_padding.scss +1 -1
  17. data/sass/susy/helpers/_box-sizing.scss +16 -0
  18. data/sass/susy/helpers/_clearfix.scss +15 -0
  19. data/sass/susy/helpers/_direction.scss +7 -10
  20. data/sass/susy/helpers/_nth.scss +2 -6
  21. data/sass/susy/language/_shared.scss +0 -1
  22. data/sass/susy/language/_susy.scss +4 -1
  23. data/sass/susy/language/shared/_settings.scss +55 -249
  24. data/sass/susy/language/susy/_background.scss +304 -90
  25. data/sass/susy/language/susy/_bleed.scss +109 -0
  26. data/sass/susy/language/susy/_container.scss +21 -40
  27. data/sass/susy/language/susy/_context.scss +34 -0
  28. data/sass/susy/language/susy/_gallery.scss +53 -39
  29. data/sass/susy/language/susy/_gutters.scss +105 -83
  30. data/sass/susy/language/susy/_isolate.scss +24 -31
  31. data/sass/susy/language/susy/_margins.scss +17 -71
  32. data/sass/susy/language/susy/_padding.scss +13 -29
  33. data/sass/susy/language/susy/_rows.scss +61 -33
  34. data/sass/susy/language/susy/_settings.scss +41 -0
  35. data/sass/susy/language/susy/_span.scss +125 -278
  36. data/sass/susy/math/_columns.scss +25 -50
  37. data/sass/susy/math/_container.scss +12 -27
  38. data/sass/susy/math/_location.scss +10 -22
  39. data/templates/project/README.md +3 -3
  40. metadata +44 -176
  41. data/docs/BUGS.md +0 -2
  42. data/docs/Gemfile.lock +0 -142
  43. data/docs/README.md +0 -54
  44. data/docs/config.rb +0 -120
  45. data/docs/lib/guide_helpers.rb +0 -19
  46. data/docs/source/apple-touch-icon-114x114-precomposed.png +0 -0
  47. data/docs/source/apple-touch-icon-144x144-precomposed.png +0 -0
  48. data/docs/source/apple-touch-icon-72x72-precomposed.png +0 -0
  49. data/docs/source/apple-touch-icon-precomposed.png +0 -0
  50. data/docs/source/demos/grid-types.html.md +0 -263
  51. data/docs/source/demos/index.html.md +0 -23
  52. data/docs/source/demos/magic.html.md +0 -320
  53. data/docs/source/favicon.ico +0 -0
  54. data/docs/source/fonts/@Font-Face License.txt +0 -18
  55. data/docs/source/fonts/Baskerville-amp-webfont.eot +0 -0
  56. data/docs/source/fonts/Baskerville-amp-webfont.svg +0 -241
  57. data/docs/source/fonts/Baskerville-amp-webfont.ttf +0 -0
  58. data/docs/source/fonts/Baskerville-amp-webfont.woff +0 -0
  59. data/docs/source/fonts/CenturyOldStyle-Bold-webfont.eot +0 -0
  60. data/docs/source/fonts/CenturyOldStyle-Bold-webfont.svg +0 -240
  61. data/docs/source/fonts/CenturyOldStyle-Bold-webfont.ttf +0 -0
  62. data/docs/source/fonts/CenturyOldStyle-Bold-webfont.woff +0 -0
  63. data/docs/source/fonts/CenturyOldStyle-Italic-webfont.eot +0 -0
  64. data/docs/source/fonts/CenturyOldStyle-Italic-webfont.svg +0 -240
  65. data/docs/source/fonts/CenturyOldStyle-Italic-webfont.ttf +0 -0
  66. data/docs/source/fonts/CenturyOldStyle-Italic-webfont.woff +0 -0
  67. data/docs/source/fonts/CenturyOldStyle-Regular-webfont.eot +0 -0
  68. data/docs/source/fonts/CenturyOldStyle-Regular-webfont.svg +0 -240
  69. data/docs/source/fonts/CenturyOldStyle-Regular-webfont.ttf +0 -0
  70. data/docs/source/fonts/CenturyOldStyle-Regular-webfont.woff +0 -0
  71. data/docs/source/fonts/CenturyOldStyleCaps-Regular-webfont.eot +0 -0
  72. data/docs/source/fonts/CenturyOldStyleCaps-Regular-webfont.svg +0 -240
  73. data/docs/source/fonts/CenturyOldStyleCaps-Regular-webfont.ttf +0 -0
  74. data/docs/source/fonts/CenturyOldStyleCaps-Regular-webfont.woff +0 -0
  75. data/docs/source/fonts/FranklinGothic-Book-webfont.eot +0 -0
  76. data/docs/source/fonts/FranklinGothic-Book-webfont.svg +0 -240
  77. data/docs/source/fonts/FranklinGothic-Book-webfont.ttf +0 -0
  78. data/docs/source/fonts/FranklinGothic-Book-webfont.woff +0 -0
  79. data/docs/source/fonts/FranklinGothic-BookIt-webfont.eot +0 -0
  80. data/docs/source/fonts/FranklinGothic-BookIt-webfont.svg +0 -240
  81. data/docs/source/fonts/FranklinGothic-BookIt-webfont.ttf +0 -0
  82. data/docs/source/fonts/FranklinGothic-BookIt-webfont.woff +0 -0
  83. data/docs/source/fonts/FranklinGothic-Cd-webfont.eot +0 -0
  84. data/docs/source/fonts/FranklinGothic-Cd-webfont.svg +0 -240
  85. data/docs/source/fonts/FranklinGothic-Cd-webfont.ttf +0 -0
  86. data/docs/source/fonts/FranklinGothic-Cd-webfont.woff +0 -0
  87. data/docs/source/fonts/FranklinGothic-CdIt-webfont.eot +0 -0
  88. data/docs/source/fonts/FranklinGothic-CdIt-webfont.svg +0 -240
  89. data/docs/source/fonts/FranklinGothic-CdIt-webfont.ttf +0 -0
  90. data/docs/source/fonts/FranklinGothic-CdIt-webfont.woff +0 -0
  91. data/docs/source/fonts/FranklinGothic-Med-webfont.eot +0 -0
  92. data/docs/source/fonts/FranklinGothic-Med-webfont.svg +0 -240
  93. data/docs/source/fonts/FranklinGothic-Med-webfont.ttf +0 -0
  94. data/docs/source/fonts/FranklinGothic-Med-webfont.woff +0 -0
  95. data/docs/source/fonts/FranklinGothic-MedCd-webfont.eot +0 -0
  96. data/docs/source/fonts/FranklinGothic-MedCd-webfont.svg +0 -240
  97. data/docs/source/fonts/FranklinGothic-MedCd-webfont.ttf +0 -0
  98. data/docs/source/fonts/FranklinGothic-MedCd-webfont.woff +0 -0
  99. data/docs/source/fonts/FranklinGothic-MedCdIt-webfont.eot +0 -0
  100. data/docs/source/fonts/FranklinGothic-MedCdIt-webfont.svg +0 -240
  101. data/docs/source/fonts/FranklinGothic-MedCdIt-webfont.ttf +0 -0
  102. data/docs/source/fonts/FranklinGothic-MedCdIt-webfont.woff +0 -0
  103. data/docs/source/fonts/FranklinGothic-MedIt-webfont.eot +0 -0
  104. data/docs/source/fonts/FranklinGothic-MedIt-webfont.svg +0 -240
  105. data/docs/source/fonts/FranklinGothic-MedIt-webfont.ttf +0 -0
  106. data/docs/source/fonts/FranklinGothic-MedIt-webfont.woff +0 -0
  107. data/docs/source/fonts/License.txt +0 -77
  108. data/docs/source/fonts/susy.eot +0 -0
  109. data/docs/source/fonts/susy.svg +0 -69
  110. data/docs/source/fonts/susy.ttf +0 -0
  111. data/docs/source/fonts/susy.woff +0 -0
  112. data/docs/source/guides/getting-started.html.md +0 -277
  113. data/docs/source/guides/reference.html.md +0 -658
  114. data/docs/source/guides/upgrade-1-0.html.md +0 -286
  115. data/docs/source/humans.txt +0 -45
  116. data/docs/source/images/splash-iphone.png +0 -0
  117. data/docs/source/images/splash-iphone4.png +0 -0
  118. data/docs/source/images/splash-landscape.png +0 -0
  119. data/docs/source/images/splash-portrait.png +0 -0
  120. data/docs/source/index.html.md +0 -87
  121. data/docs/source/javascripts/jquery-1.7.1.min.js +0 -4
  122. data/docs/source/javascripts/jqwidont.js +0 -5
  123. data/docs/source/javascripts/modernizr-2.5.3.min.js +0 -4
  124. data/docs/source/javascripts/modernizr.selectors.js +0 -55
  125. data/docs/source/javascripts/viewport.js +0 -9
  126. data/docs/source/layouts/grid-types.haml +0 -22
  127. data/docs/source/layouts/layout.haml +0 -34
  128. data/docs/source/layouts/magic.haml +0 -28
  129. data/docs/source/partials/_contentinfo.haml +0 -47
  130. data/docs/source/partials/_demonav.haml +0 -2
  131. data/docs/source/partials/_google_analytics.haml +0 -5
  132. data/docs/source/partials/_head.haml +0 -22
  133. data/docs/source/partials/_javascripts.haml +0 -4
  134. data/docs/source/partials/_navigation.haml +0 -15
  135. data/docs/source/sites-using-susy.html.md +0 -29
  136. data/docs/source/stylesheets/_base/_base.scss +0 -23
  137. data/docs/source/stylesheets/_base/_colors.scss +0 -47
  138. data/docs/source/stylesheets/_base/_size.scss +0 -49
  139. data/docs/source/stylesheets/_base/_type.scss +0 -19
  140. data/docs/source/stylesheets/_demos/_demo.scss +0 -28
  141. data/docs/source/stylesheets/_demos/magic/_layout.scss +0 -39
  142. data/docs/source/stylesheets/_demos/magic/_style.scss +0 -104
  143. data/docs/source/stylesheets/_demos/types/_layouts.scss +0 -88
  144. data/docs/source/stylesheets/_demos/types/_template.scss +0 -57
  145. data/docs/source/stylesheets/_general/_century-oldstyle.scss +0 -70
  146. data/docs/source/stylesheets/_general/_font-license.scss +0 -23
  147. data/docs/source/stylesheets/_general/_fonts.scss +0 -26
  148. data/docs/source/stylesheets/_general/_franklin-gothic.scss +0 -112
  149. data/docs/source/stylesheets/_general/_icons.scss +0 -86
  150. data/docs/source/stylesheets/_general/_root.scss +0 -79
  151. data/docs/source/stylesheets/_general/_type.scss +0 -114
  152. data/docs/source/stylesheets/_layout.scss +0 -48
  153. data/docs/source/stylesheets/_modules/_ag-test.scss +0 -59
  154. data/docs/source/stylesheets/_modules/_banner.scss +0 -61
  155. data/docs/source/stylesheets/_modules/_contentinfo.scss +0 -41
  156. data/docs/source/stylesheets/_modules/_intro.scss +0 -53
  157. data/docs/source/stylesheets/_modules/_nav.scss +0 -44
  158. data/docs/source/stylesheets/_modules/_pages.scss +0 -5
  159. data/docs/source/stylesheets/_modules/_secondary.scss +0 -22
  160. data/docs/source/stylesheets/_modules/_toggle.scss +0 -40
  161. data/docs/source/stylesheets/_vendor/pygments/solarized.scss +0 -65
  162. data/docs/source/stylesheets/grid-types.css.scss +0 -6
  163. data/docs/source/stylesheets/magic.css.scss +0 -6
  164. data/docs/source/stylesheets/site.css.scss +0 -27
  165. data/sass/susy/language/_susy1.scss +0 -9
  166. data/sass/susy/language/shared/_context.scss +0 -36
  167. data/sass/susy/language/susy1/_settings.scss +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 46be92875abbfabd5a08c7190610555dbaca91ae
4
- data.tar.gz: fe798a70237e5369c6a007550753af7a95523044
5
- SHA512:
6
- metadata.gz: 3e4c356738b99d6148a9b2d4af4664ee6c51e3600e59e6747b02536b481b2d35ed7af1b3d633e32a77d3d90cda1782d9e08ef6e0aaec6b4912200bdbb6757c30
7
- data.tar.gz: caf82262dd8131a8384fda277375fc6393a18cbdf60686ba15afc2666b53b89edf52e2f4911eb6d51990813719dce2b18b103818d1caba7ed565615a7b07b062
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e517f778e7f713696b11510f0a423df0e9a063f9
4
+ data.tar.gz: e914949051598b83a963cd9ffea85270b3afab05
5
+ SHA512:
6
+ metadata.gz: 144fcea1e2eb1b17bc1903c741f7b7824e412f6f99218a0da4614f7c5913d50da46abb821bf48624faf4baed70bddcc1e076ee8c77a84971739dcb9c13b3d506
7
+ data.tar.gz: e4e421fc81b114835a68e5003fc69c72529cac96140fdfa9fad74a71443e12340d802796449cdb68ec1ba30261108bf35049a44452ea5f38cdb0825c66e353ef
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/ericam/susy.png?branch=susy-next)](https://travis-ci.org/ericam/susy)
2
+
1
3
  # Susy [a Compass plugin]
2
4
 
3
5
  Susy is a semantic CSS grid system with a responsive twist.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.0.alpha.4
@@ -0,0 +1 @@
1
+ require 'susy'
@@ -1,4 +1,12 @@
1
- require 'compass'
2
- Compass::Frameworks.register('susy',
3
- :stylesheets_directory => File.join(File.dirname(__FILE__), '..', 'sass'),
4
- :templates_directory => File.join(File.dirname(__FILE__), '..', 'templates'))
1
+ susy_stylesheets_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'sass'))
2
+ begin
3
+ require 'compass'
4
+ Compass::Frameworks.register('susy', :stylesheets_directory => susy_stylesheets_path)
5
+ rescue LoadError
6
+ # compass not found, register on the Sass path via the environment.
7
+ if ENV.has_key?("SASSPATH")
8
+ ENV["SASSPATH"] = ENV["SASSPATH"] + File::PATH_SEPARATOR + susy_stylesheets_path
9
+ else
10
+ ENV["SASSPATH"] = susy_stylesheets_path
11
+ end
12
+ end
@@ -1,5 +1,7 @@
1
1
  // Helpers
2
2
  // =======
3
3
 
4
+ @import "helpers/clearfix";
5
+ @import "helpers/box-sizing";
4
6
  @import "helpers/direction";
5
7
  @import "helpers/nth";
@@ -1,23 +1,10 @@
1
1
  // Settings
2
2
  // ========
3
3
 
4
- // Grid Basics
5
- // -----------
6
-
7
- $columns : 4 !default;
8
- $gutters : .25 !default;
9
-
10
- // Grid Widths [optional]
11
- // ----------------------
12
- // - Set EITHER $column-width OR $container
13
- // - Use $column-width for static layouts
14
- // - We can determine one from the other, but we can't resolve conflicts
15
-
16
- $column-width : false !default;
17
- $container : auto !default;
18
-
19
- // Last Flow
20
- // ---------
21
- // - Last/Omega float-direction, relative to the document flow
22
- // from | to
23
- $last-flow : to !default;
4
+ // Default Settings
5
+ // ----------------
6
+ $susy-defaults: (
7
+ columns: 4,
8
+ gutters: .25,
9
+ column-width: false,
10
+ );
@@ -1,6 +1,8 @@
1
1
  // Float API
2
2
  // =========
3
3
 
4
+ @import "shared";
5
+
4
6
  @import "float/container";
5
7
  @import "float/span";
6
8
  @import "float/end";
@@ -1,18 +1,16 @@
1
1
  // Float Container API
2
2
  // ===================
3
3
 
4
- @import "compass/utilities/general/clearfix";
5
-
6
4
  // Float Container
7
5
  // ---------------
8
6
  // - [$width] : <length>
9
7
  // - [$justify] : left | center | right
10
8
  // - [$layout-math] : fluid | static
11
9
  @mixin float-container(
12
- $width : $container,
13
- $justify : $container-position,
14
- $layout-math : $layout-math
10
+ $width : susy-get(container),
11
+ $justify : susy-get(container-position),
12
+ $layout-math : susy-get(layout-math)
15
13
  ) {
16
- @include pie-clearfix;
14
+ @include susy-clearfix;
17
15
  @include container-output($width, $justify, $layout-math);
18
16
  }
@@ -5,25 +5,21 @@
5
5
  // ----------
6
6
  // - [$flow] : ltr | rtl
7
7
  @mixin float-last(
8
- $flow: $flow,
9
- $last-flow: $last-flow
8
+ $flow: susy-get(flow),
9
+ $last-flow: susy-get(last-flow),
10
+ $margin: 0
10
11
  ) {
11
12
  $to: to($flow);
12
13
 
13
- @if $last-flow == to {
14
- float: $to;
15
- }
16
-
17
- margin-#{$to}: 0;
14
+ float: if($last-flow == to, $to, null);
15
+ margin-#{$to}: $margin;
18
16
  }
19
17
 
20
18
  // Float First
21
19
  // -----------
22
20
  // - [$flow] : ltr | rtl
23
21
  @mixin float-first(
24
- $flow: $flow
22
+ $flow: susy-get(flow)
25
23
  ) {
26
- $from: from($flow);
27
-
28
- margin-#{$from}: 0;
24
+ margin-#{from($flow)}: 0;
29
25
  }
@@ -7,7 +7,7 @@
7
7
  // - [$flow] : ltr | rtl
8
8
  @mixin isolate-output(
9
9
  $push,
10
- $flow : $flow
10
+ $flow : susy-get(flow)
11
11
  ) {
12
12
  $to : to($flow);
13
13
  $from : from($flow);
@@ -17,19 +17,13 @@
17
17
  $margin-after : null,
18
18
  $padding-before : null,
19
19
  $padding-after : null,
20
- $flow : $flow
20
+ $flow : susy-get(flow)
21
21
  ) {
22
22
  $to : to($flow);
23
23
  $from : from($flow);
24
24
 
25
- @if $float {
26
- $float: if($float == to, $to, $from);
27
- } @else {
28
- $float: null;
29
- }
30
-
31
25
  width: $width;
32
- float: $float;
26
+ float: if($float == to, $to, null) or if($float == from, $from, null);
33
27
  margin-#{$from}: $margin-before;
34
28
  margin-#{$to}: $margin-after;
35
29
  padding-#{$from}: $padding-before;
@@ -2,47 +2,35 @@
2
2
  // ===================
3
3
  // - Sub-pixel rounding can lead to several pixels variation between browsers.
4
4
 
5
- @import "compass/layout/grid-background";
6
- @import "compass/css3/images";
7
- @import "compass/css3/background-size";
8
-
9
- // Set the line height for your vertical rhythm.
10
- $base-line-height : 24px !default;
11
-
12
5
  // Grid Background Output
13
6
  // ----------------------
14
- // $stops : <list> (gradient color-stops)
15
- // [$show] : show | show-columns | show-gutters | hide
16
- // [$flow] : ltr | rtl
7
+ // - $image: background-image
8
+ // - $size: background-size
9
+ // - $clip: background-clip
10
+ // - [$flow]: ltr | rtl
17
11
  @mixin background-grid-output (
18
- $stops,
19
- $line-height : $base-line-height,
20
- $show : $show-grids,
21
- $flow : $flow
12
+ $image,
13
+ $size: false,
14
+ $clip: false,
15
+ $flow: susy-get(flow)
22
16
  ) {
23
- $to : to($flow);
24
- $from : from($flow);
25
-
26
- // set the proper background gradient
27
- $background: ();
28
-
29
- @if $show and $show != hide {
30
-
31
- @if $show != show-columns {
32
- $background: append($background, get-baseline-gradient(), comma);
33
- }
34
-
35
- @if $show != show-baseline {
36
- $background: append($background, linear-gradient($from, $stops...), comma);
37
- }
38
-
39
- // output styles
40
- @include background($background);
17
+ @if mixin-exists(background-image) {
18
+ @include background-image($image);
19
+ } @else {
20
+ background-image: $image;
21
+ }
41
22
 
42
- @if $show != show-columns {
43
- @include background-size(100% $line-height);
44
- background-position: left top;
45
- }
23
+ @if $size {
24
+ -webkit-background-size: $size;
25
+ background-size: $size;
26
+ }
46
27
 
28
+ @if $clip {
29
+ -webkit-background-origin: $clip;
30
+ -webkit-background-clip: $clip;
31
+ background-origin: $clip;
32
+ background-clip: $clip;
47
33
  }
34
+
35
+ background-position: from($flow) top;
48
36
  }
@@ -7,20 +7,14 @@
7
7
  // - [$justify] : left | center | right
8
8
  // - [$layout-math] : fluid | static
9
9
  @mixin container-output(
10
- $width : $container,
11
- $justify : $container-position,
12
- $layout-math : $layout-math
10
+ $width : susy-get(container),
11
+ $justify : susy-get(container-position),
12
+ $layout-math : susy-get(layout-math)
13
13
  ) {
14
- $position : parse-container-position($justify);
15
14
  $property : if($layout-math == static, width, max-width);
16
- $left : nth($position,1);
17
- $right : nth($position,2);
15
+ $justify : parse-container-position($justify);
18
16
 
19
- @if not $width {
20
- $width: 100%;
21
- }
22
-
23
- #{$property}: $width;
24
- margin-left: $left;
25
- margin-right: $right;
17
+ #{$property}: $width or 100%;
18
+ margin-left: nth($justify, 1);
19
+ margin-right: nth($justify, 2);
26
20
  }
@@ -9,7 +9,7 @@
9
9
  @mixin margin-output(
10
10
  $before,
11
11
  $after,
12
- $flow: $flow
12
+ $flow: susy-get(flow)
13
13
  ) {
14
14
  $to: to($flow);
15
15
  $from: from($flow);
@@ -9,7 +9,7 @@
9
9
  @mixin padding-output(
10
10
  $before,
11
11
  $after,
12
- $flow: $flow
12
+ $flow: susy-get(flow)
13
13
  ) {
14
14
  $to: to($flow);
15
15
  $from: from($flow);
@@ -0,0 +1,16 @@
1
+ // Box Sizing
2
+ // ==========
3
+ // Susy is not in the business of handling css3 prefixed feature support.
4
+ // If you provide a mixin, we'll use yours, otherwise we provide basics.
5
+ // If you want more powerful support handling, we recommend compass-style.org
6
+
7
+ // Susy Box Sizing
8
+ // ---------------
9
+ // [$model]: content-box | border-box
10
+ @mixin susy-box-sizing(
11
+ $model: content-box
12
+ ) {
13
+ -moz-box-sizing: $model;
14
+ -webkit-box-sizing: $model;
15
+ box-sizing: $model;
16
+ }
@@ -0,0 +1,15 @@
1
+ // Susy Fallback Clearfix
2
+ // ======================
3
+ // If you provide a clearfix mixin, we'll use yours.
4
+ // If not, we'll provide the basics.
5
+
6
+ // Susy Clearfix
7
+ // -------------
8
+ @mixin susy-clearfix {
9
+ *zoom: 1;
10
+ &:after {
11
+ content : " ";
12
+ display : block;
13
+ clear : both;
14
+ }
15
+ }
@@ -7,14 +7,11 @@
7
7
  // - [$flow] : ltr | rtl
8
8
  // - [$key] : from | to
9
9
  @function get-direction(
10
- $flow: $flow,
10
+ $flow: susy-get(flow),
11
11
  $key: from
12
12
  ) {
13
- $from: if($flow == rtl, right, left);
14
- $to: if($flow == rtl, left, right);
15
-
16
- @if $key == from { @return $from; }
17
- @else if $key == to { @return $to; }
13
+ $return: if($flow == rtl, (from: right, to: left), (from: left, to: right));
14
+ @return map-get($return, $key);
18
15
  }
19
16
 
20
17
  // To
@@ -22,9 +19,9 @@
22
19
  // Return the 'to' direction of a flow
23
20
  // - [$flow] : ltr | rtl
24
21
  @function to(
25
- $flow: $flow
22
+ $flow: susy-get(flow)
26
23
  ) {
27
- @return get-direction($flow,to);
24
+ @return get-direction($flow, to);
28
25
  }
29
26
 
30
27
  // From
@@ -32,7 +29,7 @@
32
29
  // Return the 'from' direction of a flow
33
30
  // - [$flow] : ltr | rtl
34
31
  @function from(
35
- $flow: $flow
32
+ $flow: susy-get(flow)
36
33
  ) {
37
- @return get-direction($flow,from);
34
+ @return get-direction($flow, from);
38
35
  }
@@ -10,10 +10,6 @@
10
10
  $n : last,
11
11
  $selector : child
12
12
  ) {
13
- @if ($n == 'last') or ($n =='first') or ($n =='only') {
14
- $selector: '#{$n}-#{$selector}';
15
- } @else {
16
- $selector: 'nth-#{$selector}(#{$n})';
17
- }
18
- @return $selector;
13
+ $key: last first only;
14
+ @return if(index($key, $n), '#{$n}-#{$selector}', 'nth-#{$selector}(#{$n})');
19
15
  }
@@ -2,4 +2,3 @@
2
2
  // =============
3
3
 
4
4
  @import "shared/settings";
5
- @import "shared/context";
@@ -2,10 +2,12 @@
2
2
  // ================
3
3
 
4
4
  @import "../core";
5
- @import "../api/shared";
6
5
  @import "../api/float";
7
6
 
8
7
  @import "shared";
8
+
9
+ @import "susy/settings";
10
+ @import "susy/context";
9
11
  @import "susy/background";
10
12
  @import "susy/container";
11
13
  @import "susy/span";
@@ -15,3 +17,4 @@
15
17
  @import "susy/rows";
16
18
  @import "susy/margins";
17
19
  @import "susy/padding";
20
+ @import "susy/bleed";
@@ -1,107 +1,36 @@
1
1
  // Grid Syntax
2
2
  // ===========
3
3
 
4
- // layout math
5
- // - static | fluid
6
- $layout-math : fluid !default;
7
-
8
- // layout method
9
- // - isolate | float
10
- $layout-method : float !default;
11
-
12
- // layout direction
13
- // - ltr | rtl
14
- $flow : ltr !default;
15
-
16
- // box-sizing
17
- // false | border-box | content-box
18
- $box-sizing : false !default;
19
-
20
- // container justification
21
- // - left | center | right
22
- $container-position : center !default;
23
-
24
- // gutter handling
25
- // - before | after | split | inside | inside-static | no-gutters
26
- $gutter-position : after !default;
27
-
28
- // show/hide grids
29
- // show | show-columns | show-baseline | hide
30
- $show-grids : show-columns !default;
31
-
32
4
  // Set Grid
33
5
  // --------
34
6
  // Set a new grid using a shorthand
35
7
  // - $grid : <settings>
36
- // - [$clean] : true | false (resets container, column-width, & box-sizing)
37
8
  @mixin set-grid(
38
- $grid,
39
- $clean: false
9
+ $grid
40
10
  ) {
11
+ $susy: map-merge($susy, parse-grid($grid)) !global;
12
+ }
41
13
 
42
- $grid : get-adjusted-grid($grid, $clean);
43
-
44
- // get values
45
- $columns : get-setting(columns, $grid);
46
- $gutters : get-setting(gutters, $grid);
47
- $container : get-setting(container, $grid);
48
- $column-width : get-setting(column-width, $grid);
49
- $layout-math : get-setting(layout-math, $grid);
50
- $layout-method : get-setting(layout-method, $grid);
51
-
52
- $flow : get-setting(flow, $grid);
53
- $gutter-position : get-setting(gutter-position, $grid);
54
- $container-position : get-setting(container-position, $grid);
55
- $show-grids : get-setting(show-grids, $grid);
56
- $box : get-setting(box-sizing, $grid);
57
-
58
- $container : get-setting(container, $grid);
59
- $column-width : get-setting(column-width, $grid);
60
- $box-sizing : get-setting(box-sizing, $grid);
14
+ // Alternative syntax
15
+ @mixin susy-set(
16
+ $grid
17
+ ) {
18
+ @include set-grid($grid);
61
19
  }
62
20
 
63
21
  // Use Grid
64
22
  // --------
65
23
  // Use an arbitrary grid for a section of code
66
24
  // - $grid : <settings>
67
- // - [$clean] : true | false (resets container, column-width, & box-sizing)
68
25
  @mixin use-grid(
69
- $grid,
70
- $clean: false
26
+ $grid
71
27
  ) {
72
- $old-grid: get-grid();
28
+ $old: $susy;
73
29
 
74
- @include set-grid($grid, $clean);
30
+ @include set-grid($grid);
75
31
  @content;
76
- @include set-grid($old-grid, $clean);
77
- }
78
32
 
79
- // Get Grid
80
- // --------
81
- // Get the current grid settings as a shorthand list
82
- @function get-grid(
83
- ) {
84
- $new-gutters : $gutters;
85
- $new-show-grids : false;
86
-
87
- // Use units for column/gutter ratio if available
88
- @if $column-width {
89
- $new-gutters: $column-width $column-width * $gutters;
90
- }
91
-
92
- // Create keyword for show-grids setting
93
- @if type-of($show-grids) == bool {
94
- @if $show-grids {
95
- $new-show-grids: show;
96
- } @else {
97
- $new-show-grids: hide;
98
- }
99
- } @else {
100
- $new-show-grids: $show-grids;
101
- }
102
-
103
- // Return grid shorthand
104
- @return compact($container $columns $new-gutters $layout-math $layout-method $container-position $new-show-grids $flow $gutter-position $box-sizing);
33
+ $susy: $old !global;
105
34
  }
106
35
 
107
36
  // Parse Grid
@@ -109,190 +38,67 @@ $show-grids : show-columns !default;
109
38
  // Parse a shorthand grid, and return an ordered list of settings
110
39
  // - [$grid] : <settings>
111
40
  @function parse-grid(
112
- $grid: get-grid()
41
+ $grid
113
42
  ) {
114
- $new-columns : false;
115
- $new-gutters : false;
116
- $new-container : false;
117
- $new-column-width : false;
118
- $new-layout-math : false;
119
- $new-layout-method : false;
120
- $new-container-position : false;
121
- $new-flow : false;
122
- $new-gutter-position : false;
123
- $new-show-grids : false;
124
- $new-box-sizing : false;
125
-
126
- $columns-check : false;
43
+ $return: $grid;
127
44
 
128
- @each $value in $grid {
129
- @if type-of($value) == string {
130
- // layout-math: static | fluid
131
- @if $value == static {
132
- $new-layout-math: static;
133
- } @else if $value == fluid {
134
- $new-layout-math: fluid;
135
- }
45
+ @if type-of($grid) != map {
46
+ $return : ();
47
+ $columns-check : false;
136
48
 
137
- // layout-method: isolate | fluid
138
- @if $value == isolate {
139
- $new-layout-method: isolate;
140
- } @else if $value == float {
141
- $new-layout-method: float;
142
- }
49
+ @each $item in $grid {
143
50
 
144
- // container-position: left | center | right
145
- @if $value == left {
146
- $new-container-position: left;
147
- } @else if $value == right {
148
- $new-container-position: right;
149
- } @else if $value == center {
150
- $new-container-position: center;
151
- }
51
+ // maps
52
+ @if type-of($item) == map {
53
+ $return: map-merge($return, $item);
152
54
 
153
- // flow: ltr | rtl
154
- @if $value == rtl {
155
- $new-flow: rtl;
156
- } @else if $value == ltr {
157
- $new-flow: ltr;
55
+ // Keywords
56
+ } @else if type-of($item) == string {
57
+ @each $key, $value in $susy-keywords {
58
+ @if index($value, $item) {
59
+ $return: map-merge($return, ($key: $item));
60
+ }
61
+ }
158
62
  }
159
63
 
160
- // show-grid: show | hide
161
- @if $value == show {
162
- $new-show-grids: show;
163
- } @else if $value == hide {
164
- $new-show-grids: hide;
165
- } @else if $value == show-columns {
166
- $new-show-grids: show-columns;
167
- } @else if $value == show-baseline {
168
- $new-show-grids: show-baseline;
64
+ // Container, Columns, or Gutters
65
+ @else if type-of($item) == number {
66
+ @if not unitless($item) {
67
+ $return: map-merge($return, (container: $item));
68
+ } @else if not $columns-check {
69
+ $return: map-merge($return, (columns: $item));
70
+ $columns-check: true;
71
+ } @else {
72
+ $return: map-merge($return, (gutters: $item));
73
+ }
169
74
  }
170
75
 
171
- // gutter-position: before | after | split | no-gutters
172
- @if $value == before {
173
- $new-gutter-position: before;
174
- } @else if $value == after {
175
- $new-gutter-position: after;
176
- } @else if $value == split {
177
- $new-gutter-position: split;
178
- } @else if $value == inside {
179
- $new-gutter-position: inside;
180
- } @else if $value == inside-static {
181
- $new-gutter-position: inside-static;
182
- } @else if $value == no-gutters {
183
- $new-gutter-position: no-gutters;
184
- }
185
-
186
- // box-sizing: border-box | content-box
187
- @if $value == border-box {
188
- $new-box-sizing: border-box;
189
- } @else if $value == content-box {
190
- $new-box-sizing: content-box;
191
- }
192
-
193
- // auto container
194
- @if $value == auto {
195
- $new-container: auto;
196
- }
197
- }
198
-
199
- // container, columns, or gutters
200
- @else if type-of($value) == number {
201
- @if not unitless($value) {
202
- $new-container: $value;
203
- } @else if not $columns-check {
204
- $new-columns: $value;
205
- $columns-check: true;
206
- } @else {
207
- $new-gutters: $value;
208
- }
209
- }
210
-
211
- // columns or gutters
212
- @else if type-of($value) == list {
213
- @if unitless(nth($value,1)) {
214
- $new-columns: $value;
215
- $columns-check: true;
216
- } @else {
217
- $new-column-width: nth($value,1);
218
- $new-gutters: nth($value,2) / nth($value,1);
76
+ // Columns or Gutters
77
+ @else if type-of($item) == list {
78
+ @if unitless(nth($item,1)) {
79
+ $return: map-merge($return, (columns: $item));
80
+ $columns-check: true;
81
+ } @else {
82
+ $return: map-merge($return, (column-width: nth($item,1)));
83
+ $return: map-merge($return, (gutters: nth($item,2) / nth($item,1)));
84
+ }
219
85
  }
220
86
  }
221
87
  }
222
88
 
223
- @return $new-columns $new-gutters $new-container $new-column-width $new-layout-math $new-layout-method $new-container-position $new-flow $new-gutter-position $new-show-grids $new-box-sizing;
224
- }
225
-
226
- // Get Adjusted Grid
227
- // -----------------
228
- // Fill missing grid values based on global settings
229
- // - $grid : <settings>
230
- // - [$clean] : true | false (resets container, column-width, & box-sizing)
231
- @function get-adjusted-grid(
232
- $grid,
233
- $clean: false
234
- ) {
235
- $grid : parse-grid($grid);
236
-
237
- $new-columns : get-setting(columns, $grid);
238
- $new-gutters : get-setting(gutters, $grid);
239
- $new-layout-math : get-setting(layout-math, $grid);
240
- $new-layout-method : get-setting(layout-method, $grid);
241
- $new-flow : get-setting(flow, $grid);
242
- $new-gutter-place : get-setting(gutter-position, $grid);
243
- $new-container-position : get-setting(container-position, $grid);
244
- $new-show-grids : get-setting(show-grids, $grid);
245
-
246
- $new-container : get-setting(container, $grid);
247
- $new-column-width : get-setting(column-width, $grid);
248
- $new-box-sizing : get-setting(box-sizing, $grid);
249
-
250
- // Set required values
251
- $new-columns : if($new-columns, $new-columns, $columns);
252
- $new-gutters : if($new-gutters, $new-gutters, $gutters);
253
- $new-layout-math : if($new-layout-math, $new-layout-math, $layout-math);
254
- $new-layout-method : if($new-layout-method, $new-layout-method, $layout-method);
255
- $new-flow : if($new-flow, $new-flow, $flow);
256
- $new-gutter-place : if($new-gutter-place, $new-gutter-place, $gutter-position);
257
- $new-container-position : if($new-container-position, $new-container-position, $container-position);
258
- $new-show-grids : if($new-show-grids, $new-show-grids, $show-grids);
259
-
260
- // optionally fill values based on current grid
261
- @if $clean {
262
- $new-container : if($new-container, $new-container, auto);
263
- } @else {
264
- $new-container : if($new-container, $new-container, $container);
265
- $new-column-width : if($new-column-width, $new-column-width, $column-width);
266
- $new-box-sizing : if($new-box-sizing, $new-box-sizing, $box-sizing);
267
- }
268
-
269
- @return $new-columns, $new-gutters, $new-container, $new-column-width, $new-layout-math, $new-layout-method, $new-container-position, $new-flow, $new-gutter-place, $new-show-grids, $new-box-sizing;
89
+ @return $return;
270
90
  }
271
91
 
272
92
  // Get Setting
273
93
  // -----------
274
- // Return one setting from a shorhand grid
275
- // - setting : <keyword> (see $options below)
94
+ // Return one setting from a grid
95
+ // - setting : <keyword>
276
96
  // - $grid : <settings>
277
- // - [$parse] : true | false
278
- @function get-setting(
279
- $setting,
280
- $grid : parse-grid(),
281
- $parse : false
97
+ @function susy-get(
98
+ $key,
99
+ $grid: map-merge($susy-defaults, $susy)
282
100
  ) {
283
- $options : columns gutters container column-width layout-math layout-method container-position flow gutter-position show-grids box-sizing;
284
- $key : index($options, $setting);
285
- $value : false;
286
-
287
- @if $parse {
288
- $grid: parse-grid($grid);
289
- }
290
-
291
- @if $key {
292
- $value: nth($grid, $key);
293
- } @else {
294
- @warn '"#{$setting}" is not a valid grid setting.';
295
- }
101
+ $grid: parse-grid($grid);
296
102
 
297
- @return $value;
103
+ @return map-get($grid, $key) or map-get($susy, $key) or map-get($susy-defaults, $key);
298
104
  }