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

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 (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
@@ -1,137 +1,267 @@
1
1
  // Background Grid Syntax
2
2
  // ======================
3
3
 
4
- @import "compass/css3/border-radius";
5
- @import "compass/css3/box-shadow";
6
- @import "compass/layout/stretching";
4
+ $debug-defaults: (
5
+ color: rgba(#66f, .25),
6
+ toggle: top right,
7
+ );
7
8
 
8
- // The overlay is painted over your container's ::after pseudo-element,
9
- // so we must give position to the container itself.
10
- // If relative doesn't suit your layout, it can be replaced by absolute/fixed.
11
- $overlay-position : relative !default;
12
-
13
- // Set the location of the switch.
14
- $grid-toggle-position : left bottom !default;
15
-
16
- // Set the color of background grids.
17
- $grid-color : rgba(#66f, .25) !default;
18
-
19
- // Grid Background
20
- // ---------------
9
+ // Show Grid
10
+ // ---------
21
11
  // Show a grid background on any element.
22
12
  // - [$grid] : <settings>
23
- @mixin background-grid(
24
- $grid: get-grid()
13
+ @mixin show-grid(
14
+ $grid: $susy
25
15
  ) {
26
- $grid : get-adjusted-grid($grid);
16
+ $output: get-background($grid);
27
17
 
28
- $this-flow : get-setting(flow, $grid);
29
- $this-show : get-setting(show-grids, $grid);
18
+ @if length($output) > 0 {
19
+ $flow: susy-get(flow, $grid);
30
20
 
31
- $stops : get-grid-color-stops($grid);
21
+ $image: ();
22
+ @each $name, $layer in map-get($output, image) {
23
+ $direction: if($name == baseline, to bottom, to to($flow));
24
+ $image: append($image, linear-gradient($direction, $layer...), comma);
25
+ }
26
+ $output: map-merge($output, (image: $image));
27
+
28
+ @include background-grid-output($output...);
29
+ }
30
+ }
32
31
 
33
- @include background-grid-output($stops, $show: $this-show, $flow: $this-flow);
32
+ @mixin show-grids(
33
+ $grid: $susy
34
+ ) {
35
+ @include show-grid($grid);
34
36
  }
35
37
 
36
38
  // Grid Overlay
37
39
  // ------------
38
40
  // Generate an icon to trigger grid-overlays on any given elements.
39
41
  // $grids... : <selector> [<settings>] [, <selector>]*
40
- @mixin overlay-grid (
42
+ @mixin grid-overlay (
41
43
  $grids...
42
44
  ) {
43
- $vert: nth($grid-toggle-position, 1);
44
- $horz: nth($grid-toggle-position, 2);
45
-
46
45
  head {
47
- @include border-radius(.25em);
46
+ @include overlay-head;
47
+ &:hover {
48
+ @include overlay-backgrounds($grids...);
49
+ }
50
+ }
51
+ }
52
+
53
+ // [Private] Overlay Head
54
+ // ----------------------
55
+ // <head> styles to create grid overlay toggle
56
+ @mixin overlay-head {
57
+ $toggle: debug-get(toggle);
58
+ $horz: null;
59
+ $vert: null;
60
+
61
+ @each $side in $toggle {
62
+ $horz: if($side == left or $side == right, $side, $horz);
63
+ $vert: if($side == top or $side == bottom, $side, $vert);
64
+ }
65
+
66
+ display: block;
67
+ position: fixed;
68
+ #{$horz}: 10px;
69
+ #{$vert}: 10px;
70
+ z-index: 999;
71
+ color: #333;
72
+ background: rgba(white, .25);
73
+ &::before {
74
+ content: "|||";
48
75
  display: block;
49
- position: fixed;
50
- #{$horz}: 10px;
51
- #{$vert}: 10px;
52
- z-index: 999;
53
- color: #333;
54
- text-shadow: 0 0 3px #fff;
55
- &::before {
56
- content: "|||";
57
- display: block;
58
- padding: 10px 14px;
59
- letter-spacing: -1;
60
- font: {
61
- family: sans-serif;
62
- size: 26px;
63
- weight: bold;
64
- }
76
+ padding: 5px 10px;
77
+ font: {
78
+ family: sans-serif;
79
+ size: 16px;
80
+ weight: bold;
65
81
  }
66
- &:hover {
67
- @include box-shadow(0 0 3px rgba(#333,.5));
68
- background: rgba(white,.5);
69
- @each $grid in $grids {
70
- $selector: nth($grid, 1);
71
- $grid: if(length($grid) > 1, nth($grid, 2), get-grid());
72
-
73
- ~ #{$selector},
74
- ~ body #{$selector} {
75
- position: unquote($overlay-position);
76
- &::before {
77
- @extend %grid-overlay-base;
78
- @include background-grid($grid);
79
- }
80
- }
82
+ }
83
+ &:hover {
84
+ box-shadow: 0 0 1px rgba(#333,.5);
85
+ background: rgba(white, .5);
86
+ }
87
+ }
88
+
89
+ // [Private] Overlay Backgrounds
90
+ // -----------------------------
91
+ // Parse and apply backgrounds for overlay-grid
92
+ @mixin overlay-backgrounds(
93
+ $grids...
94
+ ) {
95
+ @each $grid in $grids {
96
+ $selector: nth($grid, 1);
97
+ $grid: if(length($grid) > 1, nth($grid, 2), $susy);
98
+
99
+ ~ #{$selector},
100
+ ~ body #{$selector} {
101
+ position: relative;
102
+ &::before {
103
+ @extend %grid-overlay-base;
104
+ @include show-grid($grid);
81
105
  }
82
106
  }
83
107
  }
84
108
  }
85
109
 
110
+ // [Private] Grid Overlay Base
111
+ // ---------------------------
112
+ // Base styles for generating a grid overlay
86
113
  %grid-overlay-base {
87
- @include stretch;
114
+ position: absolute;
115
+ top: 0;
116
+ left: 0;
117
+ bottom: 0;
118
+ right: 0;
88
119
  content: " ";
89
120
  z-index: 998;
90
121
  }
91
122
 
92
- // Grid Color-Stops
93
- // ----------------
94
- // Calculate the color-stops needed for a particular grid.
95
- // - $grid : <settings>
96
- @function get-grid-color-stops(
97
- $grid: parse-grid()
123
+ // Get Symmetrical Background
124
+ // --------------------------
125
+ // - $grid: <map>
126
+ @function get-background-sym(
127
+ $grid
128
+ ) {
129
+ $grid : parse-grid($grid);
130
+ $gutters : susy-get(gutters, $grid);
131
+ $column-width : susy-get(column-width, $grid);
132
+ $math : susy-get(layout-math, $grid);
133
+
134
+ $color : debug-get(color);
135
+ $trans : transparent;
136
+ $light : lighten($color, 15%);
137
+
138
+ $end : 1 + $gutters;
139
+ $after : percentage(1/$end);
140
+ $stops : ();
141
+
142
+ @if is-inside($grid) {
143
+ $stops: $color, $light;
144
+ } @else if is-split($grid) {
145
+ $split: $gutters/2;
146
+ $before: percentage($split/$end);
147
+ $after: percentage((1 + $split)/$end);
148
+ $stops: $trans $before, $color $before, $light $after, $trans $after;
149
+ } @else {
150
+ $stops: $color, $light $after, $trans $after;
151
+ }
152
+
153
+ $background: (
154
+ image: (columns: $stops),
155
+ size: if($math == static, $column-width * $end, span(1 $grid wide)),
156
+ );
157
+
158
+ @return $background;
159
+ }
160
+
161
+ // Get Asymmetrical Inside
162
+ // -----------------------
163
+ // - $grid: <settings>
164
+ @function get-asym-inside(
165
+ $grid
98
166
  ) {
99
- $stops : ();
100
- $color : $grid-color;
101
- $trans : transparent;
102
- $light : lighten($color, 15%);
167
+ $grid : parse-grid($grid);
168
+ $columns : susy-get(columns, $grid);
103
169
 
104
- $this-columns : get-setting(columns, $grid);
105
- $this-gutters : get-setting(gutters, $grid);
106
- $this-column-width : get-setting(column-width, $grid);
107
- $this-layout-math : get-setting(layout-math, $grid);
108
- $this-gutter-position : get-setting(gutter-position, $grid);
170
+ $color : debug-get(color);
171
+ $light : lighten($color, 15%);
172
+ $stops : ();
109
173
 
110
- @for $location from 1 through column-count($this-columns) {
111
- $this-stop: compact();
174
+ @for $location from 1 through column-count($columns) {
175
+ $this-stop: ();
112
176
 
113
177
  @if $location == 1 {
114
178
  $this-stop: append($this-stop, $color, comma);
115
179
  } @else {
116
- $start: get-isolation(1, $location, $this-columns, $this-gutters, $this-column-width, $this-layout-math);
180
+ $start: parse-span(1 at $location $grid);
181
+ $start: get-isolation($start);
117
182
  $this-stop: append($this-stop, $color $start, comma);
118
183
  }
119
184
 
120
- @if $location == column-count($this-columns) {
185
+ @if $location == column-count($columns) {
121
186
  $this-stop: append($this-stop, $light, comma);
122
187
  } @else {
123
- $end-color: $light;
124
- $inside: if($this-gutter-position == inside or $this-gutter-position == inside-static, true, false);
125
-
126
- @if not $inside {
127
- $gutter: get-span-width($location, 1, $this-columns, $this-gutters, $this-column-width, $this-layout-math, $this-gutter-position);
128
- $this-stop: append($this-stop, $light $gutter, comma);
129
- $this-stop: append($this-stop, $trans $gutter, comma);
130
- $end-color: $trans;
131
- }
188
+ $end: parse-span(1 at ($location + 1) $grid);
189
+ $end: get-isolation($end);
190
+ $this-stop: append($this-stop, $light $end, comma);
191
+ }
192
+
193
+ $stops: join($stops, $this-stop, comma);
194
+ }
195
+
196
+ @return $stops;
197
+ }
198
+
199
+ // Get Asymmetrical Split
200
+ // ----------------------
201
+ // - $grid: <settings>
202
+ @function get-asym-split(
203
+ $grid
204
+ ) {
205
+ $grid : parse-grid($grid);
206
+ $columns : susy-get(columns, $grid);
207
+
208
+ $color : debug-get(color);
209
+ $light : lighten($color, 15%);
210
+ $stops : ();
211
+
212
+ @for $location from 1 through column-count($columns) {
213
+ $this-stop: ();
214
+
215
+ $start: parse-span(1 at $location $grid);
216
+ $start: get-isolation($start);
217
+ $this-stop: append($this-stop, transparent $start, comma);
218
+ $this-stop: append($this-stop, $color $start, comma);
132
219
 
133
- $end: get-isolation(1, $location + 1, $this-columns, $this-gutters, $this-column-width, $this-layout-math);
134
- $this-stop: append($this-stop, $end-color $end, comma);
220
+ $end: $start + span(1 at $location $grid);
221
+ $this-stop: append($this-stop, $light $end, comma);
222
+ $this-stop: append($this-stop, transparent $end, comma);
223
+
224
+ $stops: join($stops, $this-stop, comma);
225
+ }
226
+
227
+ @return $stops;
228
+ }
229
+
230
+ // Get Asymmetrical Outside
231
+ // ------------------------
232
+ // - $grid: <settings>
233
+ @function get-asym-outside(
234
+ $grid
235
+ ) {
236
+ $grid : parse-grid($grid);
237
+ $columns : susy-get(columns, $grid);
238
+
239
+ $color : debug-get(color);
240
+ $light : lighten($color, 15%);
241
+ $trans : transparent;
242
+ $stops : ();
243
+
244
+ @for $location from 1 through column-count($columns) {
245
+ $this-stop: ();
246
+
247
+ @if $location == 1 {
248
+ $this-stop: append($this-stop, $color, comma);
249
+ } @else {
250
+ $start: parse-span(1 at $location $grid);
251
+ $start: get-isolation($start);
252
+ $this-stop: append($this-stop, $color $start, comma);
253
+ }
254
+
255
+ @if $location == column-count($columns) {
256
+ $this-stop: append($this-stop, $light, comma);
257
+ } @else {
258
+ $gutter: get-span-width(first $location $grid);
259
+
260
+ $end: parse-span(1 at ($location + 1) $grid);
261
+ $end: get-isolation($end);
262
+
263
+ $gutter: $light $gutter, $trans $gutter, $trans $end;
264
+ $this-stop: join($this-stop, $gutter, comma);
135
265
  }
136
266
 
137
267
  $stops: join($stops, $this-stop, comma);
@@ -139,3 +269,87 @@ $grid-color : rgba(#66f, .25) !default;
139
269
 
140
270
  @return $stops;
141
271
  }
272
+
273
+ // Get Asymmetrical Background
274
+ // ---------------------------
275
+ // - $grid: <settings>
276
+ @function get-background-asym(
277
+ $grid
278
+ ) {
279
+ $stops: ();
280
+
281
+ @if is-inside($grid) {
282
+ $stops: get-asym-inside($grid);
283
+ } @else if is-split($grid) {
284
+ $stops: get-asym-split($grid);
285
+ } @else {
286
+ $stops: get-asym-outside($grid);
287
+ }
288
+
289
+ @return (image: (columns: $stops));
290
+ }
291
+
292
+ // Get Background
293
+ // --------------
294
+ // - $grid: <settings>
295
+ @function get-background(
296
+ $grid
297
+ ) {
298
+ $grid : parse-grid($grid);
299
+ $show : susy-get(show-grids, $grid);
300
+ $return : ();
301
+
302
+ @if $show and $show != hide {
303
+ $line-height: variable-exists(base-line-height);
304
+ $line-height: if($line-height, $base-line-height, false);
305
+ $columns: susy-get(columns, $grid);
306
+
307
+ @if $show != show-baseline {
308
+ $sym: is-symmetrical($columns);
309
+ $return: if($sym, get-background-sym($grid), get-background-asym($grid));
310
+ $return: map-merge($return, (clip: content-box));
311
+ } @else if not $line-height {
312
+ @warn 'Please provide $base-line-height in order to see baseline grids.';
313
+ }
314
+
315
+ @if $line-height {
316
+ @if $show != show-columns {
317
+ $color: variable-exists(grid-background-baseline-color);
318
+ $color: if($color, $grid-background-baseline-color, black);
319
+
320
+ $image: map-get($return, image);
321
+ $size: map-get($return, size);
322
+ $baseline: (baseline: ($color 5%, rgba($color, 0) 5%));
323
+ $baseline-size: 100% $line-height;
324
+
325
+ $return: map-merge($return, (
326
+ image: if($image, map-merge($image, $baseline), $baseline),
327
+ size: if($size, append($size, $baseline-size, comma), $baseline-size),
328
+ ));
329
+ }
330
+
331
+ @if $show == show {
332
+ $clip: map-get($return, clip);
333
+ $return: map-merge($return, (clip: join($clip, border-box, comma)));
334
+ }
335
+ }
336
+ }
337
+
338
+ @if map-get($return, image) {
339
+ $return: map-merge($return, (flow: susy-get(flow, $grid)));
340
+ }
341
+
342
+ @return $return;
343
+ }
344
+
345
+ // Get Debug
346
+ // ---------
347
+ // Return the value of a debug setting
348
+ // - $key: <setting>
349
+ @function debug-get(
350
+ $key
351
+ ) {
352
+ $user: variable-exists(debug);
353
+ $map: if($user, map-merge($debug-defaults, $debug), $debug-defaults);
354
+ @return map-get($map, $key);
355
+ }
@@ -0,0 +1,109 @@
1
+ // Bleed Syntax
2
+ // ============
3
+
4
+ // Bleed
5
+ // -----
6
+ // Add negative margins, and equal positive padding to create bleed.
7
+ // - $span : <span>
8
+ @mixin bleed(
9
+ $bleed: 0 gutter()
10
+ ) {
11
+ $bleed : parse-bleed($bleed);
12
+ $context : get-span-context($bleed);
13
+ $trbl : span-get(span, $bleed);
14
+ $spans : (top: 0, right: 0, bottom: 0, left: 0);
15
+
16
+ $i: 1;
17
+ @each $span in $trbl {
18
+ $span: span(map-merge($bleed, (span: $span)));
19
+ @if $i == 1 {
20
+ $spans: map-merge($spans, (top: $span, right: $span, bottom: $span, left: $span));
21
+ } @else if $i == 2 {
22
+ $spans: map-merge($spans, (right: $span, left: $span));
23
+ } @else if $i == 3 {
24
+ $spans: map-merge($spans, (bottom: $span));
25
+ } @else if $i == 4 {
26
+ $spans: map-merge($spans, (left: $span));
27
+ }
28
+ $i: $i + 1;
29
+ }
30
+
31
+ @each $side, $span in $spans {
32
+ $padding: $span;
33
+ @if is-inside($bleed) and ($side == right or $side == left) {
34
+ $gutter: gutter($context);
35
+ $padding: if(comparable($padding, $gutter), $padding + $gutter, $padding);
36
+ }
37
+ margin-#{$side}: if($span != 0, 0 - $span, null);
38
+ padding-#{$side}: if($padding != 0, $padding, null);
39
+ }
40
+
41
+ @include susy-box-sizing(content-box);
42
+ }
43
+
44
+ @mixin bleed-x(
45
+ $bleed: gutter()
46
+ ) {
47
+ $bleed : parse-bleed($bleed);
48
+ $trbl : span-get(span, $bleed);
49
+
50
+ @if length($trbl) == 1 {
51
+ $bleed: map-merge($bleed, (span: 0 nth($trbl, 1)));
52
+ } @else if length($trbl) == 2 {
53
+ $bleed: map-merge($bleed, (span: 0 nth($trbl, 2) 0 nth($trbl, 1)));
54
+ } @else {
55
+ @warn 'bleed-x only takes 2 lengths, but #{length($trbl)} were passed.';
56
+ }
57
+
58
+ @include bleed($bleed);
59
+ }
60
+
61
+ @mixin bleed-y(
62
+ $bleed: if(function-exists(rhythm), rhythm(1), 1em)
63
+ ) {
64
+ $bleed : parse-bleed($bleed);
65
+ $trbl : span-get(span, $bleed);
66
+
67
+ @if length($trbl) == 1 {
68
+ $bleed: map-merge($bleed, (span: nth($trbl, 1) 0));
69
+ } @else if length($trbl) == 2 {
70
+ $bleed: map-merge($bleed, (span: nth($trbl, 1) 0 nth($trbl, 2) 0));
71
+ } @else {
72
+ @warn 'bleed-y only takes 2 lengths, but #{length($trbl)} were passed.';
73
+ }
74
+
75
+ @include bleed($bleed);
76
+ }
77
+
78
+ // Parse Bleed
79
+ // -----------
80
+ // Parse the bleed syntax, returning a TRBL list of spans
81
+ // - $bleed: <bleed>
82
+ @function parse-bleed(
83
+ $bleed
84
+ ) {
85
+ $return: $bleed;
86
+
87
+ @if type-of($bleed) != map {
88
+ $return: parse-span($bleed);
89
+ $span-list: ();
90
+ $keywords: false;
91
+ $i: 1;
92
+
93
+ @while not $keywords and $i <= length($bleed) {
94
+ $item: nth($bleed, $i);
95
+
96
+ @if type-of($item) == number {
97
+ $span-list: append($span-list, $item);
98
+ } @else {
99
+ $keywords: true;
100
+ }
101
+
102
+ $i: $i + 1;
103
+ }
104
+
105
+ $return: map-merge($return, (span: $span-list));
106
+ }
107
+
108
+ @return map-merge($return, (spread: wide));
109
+ }