susy 2.0.0.alpha.3 → 2.0.0.alpha.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA512:
3
- data.tar.gz: 7bc217525b1ca257b1d45a1bdd688ddc09417358c26228cc53083ba64f914ec1057154f51feefb76c0cf463a8ab52f368227219b69c978d73951cafdea5f1e9a
4
- metadata.gz: 0c0f837b5286717bf4dfdcd78bddafd15b19ee4d5aa9441a63774f160490133e27a5bf09f77d617c959ae883da55b93b979d959c75286fb1e09ff96700d1be92
5
2
  SHA1:
6
- data.tar.gz: db4197b6108f2e34188ca74fa198bf0677ced5d3
7
- metadata.gz: d7a5ba312e875a4172e9e391ee7cc22d9c46b21d
3
+ metadata.gz: 46be92875abbfabd5a08c7190610555dbaca91ae
4
+ data.tar.gz: fe798a70237e5369c6a007550753af7a95523044
5
+ SHA512:
6
+ metadata.gz: 3e4c356738b99d6148a9b2d4af4664ee6c51e3600e59e6747b02536b481b2d35ed7af1b3d633e32a77d3d90cda1782d9e08ef6e0aaec6b4912200bdbb6757c30
7
+ data.tar.gz: caf82262dd8131a8384fda277375fc6393a18cbdf60686ba15afc2666b53b89edf52e2f4911eb6d51990813719dce2b18b103818d1caba7ed565615a7b07b062
@@ -15,3 +15,9 @@ $gutters : .25 !default;
15
15
 
16
16
  $column-width : false !default;
17
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;
@@ -1,7 +1,7 @@
1
1
  // Shared API
2
2
  // ==========
3
3
 
4
- @import "shared/grid-background";
4
+ @import "shared/background";
5
5
  @import "shared/container";
6
6
  @import "shared/margins";
7
7
  @import "shared/padding";
@@ -1,6 +1,8 @@
1
1
  // Float Container API
2
2
  // ===================
3
3
 
4
+ @import "compass/utilities/general/clearfix";
5
+
4
6
  // Float Container
5
7
  // ---------------
6
8
  // - [$width] : <length>
@@ -5,11 +5,15 @@
5
5
  // ----------
6
6
  // - [$flow] : ltr | rtl
7
7
  @mixin float-last(
8
- $flow: $flow
8
+ $flow: $flow,
9
+ $last-flow: $last-flow
9
10
  ) {
10
11
  $to: to($flow);
11
12
 
12
- float: $to;
13
+ @if $last-flow == to {
14
+ float: $to;
15
+ }
16
+
13
17
  margin-#{$to}: 0;
14
18
  }
15
19
 
@@ -2,18 +2,23 @@
2
2
  // ===================
3
3
  // - Sub-pixel rounding can lead to several pixels variation between browsers.
4
4
 
5
- @import "compass/css3";
6
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;
7
11
 
8
12
  // Grid Background Output
9
13
  // ----------------------
10
14
  // $stops : <list> (gradient color-stops)
11
15
  // [$show] : show | show-columns | show-gutters | hide
12
16
  // [$flow] : ltr | rtl
13
- @mixin grid-background-output (
17
+ @mixin background-grid-output (
14
18
  $stops,
15
- $show : $show-grids,
16
- $flow : $flow
19
+ $line-height : $base-line-height,
20
+ $show : $show-grids,
21
+ $flow : $flow
17
22
  ) {
18
23
  $to : to($flow);
19
24
  $from : from($flow);
@@ -35,7 +40,7 @@
35
40
  @include background($background);
36
41
 
37
42
  @if $show != show-columns {
38
- @include background-size(100% $base-line-height);
43
+ @include background-size(100% $line-height);
39
44
  background-position: left top;
40
45
  }
41
46
 
@@ -22,7 +22,7 @@ $box-sizing : false !default;
22
22
  $container-position : center !default;
23
23
 
24
24
  // gutter handling
25
- // - before | after | split
25
+ // - before | after | split | inside | inside-static | no-gutters
26
26
  $gutter-position : after !default;
27
27
 
28
28
  // show/hide grids
@@ -177,6 +177,8 @@ $show-grids : show-columns !default;
177
177
  $new-gutter-position: split;
178
178
  } @else if $value == inside {
179
179
  $new-gutter-position: inside;
180
+ } @else if $value == inside-static {
181
+ $new-gutter-position: inside-static;
180
182
  } @else if $value == no-gutters {
181
183
  $new-gutter-position: no-gutters;
182
184
  }
@@ -1,6 +1,8 @@
1
1
  // Background Grid Syntax
2
2
  // ======================
3
3
 
4
+ @import "compass/css3/border-radius";
5
+ @import "compass/css3/box-shadow";
4
6
  @import "compass/layout/stretching";
5
7
 
6
8
  // The overlay is painted over your container's ::after pseudo-element,
@@ -12,16 +14,13 @@ $overlay-position : relative !default;
12
14
  $grid-toggle-position : left bottom !default;
13
15
 
14
16
  // Set the color of background grids.
15
- $grid-background-color : rgba(#66f, .25) !default;
16
-
17
- // Set the line height for your vertical rhythm.
18
- $base-line-height : 24px !default;
17
+ $grid-color : rgba(#66f, .25) !default;
19
18
 
20
19
  // Grid Background
21
20
  // ---------------
22
21
  // Show a grid background on any element.
23
22
  // - [$grid] : <settings>
24
- @mixin grid-background(
23
+ @mixin background-grid(
25
24
  $grid: get-grid()
26
25
  ) {
27
26
  $grid : get-adjusted-grid($grid);
@@ -31,14 +30,14 @@ $base-line-height : 24px !default;
31
30
 
32
31
  $stops : get-grid-color-stops($grid);
33
32
 
34
- @include grid-background-output($stops, $this-show, $this-flow);
33
+ @include background-grid-output($stops, $show: $this-show, $flow: $this-flow);
35
34
  }
36
35
 
37
36
  // Grid Overlay
38
37
  // ------------
39
38
  // Generate an icon to trigger grid-overlays on any given elements.
40
39
  // $grids... : <selector> [<settings>] [, <selector>]*
41
- @mixin grid-overlay (
40
+ @mixin overlay-grid (
42
41
  $grids...
43
42
  ) {
44
43
  $vert: nth($grid-toggle-position, 1);
@@ -76,7 +75,7 @@ $base-line-height : 24px !default;
76
75
  position: unquote($overlay-position);
77
76
  &::before {
78
77
  @extend %grid-overlay-base;
79
- @include grid-background($grid);
78
+ @include background-grid($grid);
80
79
  }
81
80
  }
82
81
  }
@@ -98,7 +97,7 @@ $base-line-height : 24px !default;
98
97
  $grid: parse-grid()
99
98
  ) {
100
99
  $stops : ();
101
- $color : $grid-background-color;
100
+ $color : $grid-color;
102
101
  $trans : transparent;
103
102
  $light : lighten($color, 15%);
104
103
 
@@ -122,8 +121,9 @@ $base-line-height : 24px !default;
122
121
  $this-stop: append($this-stop, $light, comma);
123
122
  } @else {
124
123
  $end-color: $light;
124
+ $inside: if($this-gutter-position == inside or $this-gutter-position == inside-static, true, false);
125
125
 
126
- @if $this-gutter-position != inside {
126
+ @if not $inside {
127
127
  $gutter: get-span-width($location, 1, $this-columns, $this-gutters, $this-column-width, $this-layout-math, $this-gutter-position);
128
128
  $this-stop: append($this-stop, $light $gutter, comma);
129
129
  $this-stop: append($this-stop, $trans $gutter, comma);
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  @include float-container($width, $justify, $this-layout-math);
29
- @include grid-background($grid);
29
+ @include background-grid($grid);
30
30
  }
31
31
 
32
32
  // Container [function]
@@ -1,6 +1,8 @@
1
1
  // Gallery Syntax
2
2
  // ==============
3
3
 
4
+ @import "compass/css3/box-sizing";
5
+
4
6
  // Gallery
5
7
  // -------
6
8
  // Create an isolated gallery
@@ -23,7 +25,7 @@
23
25
  $this-flow : get-span-setting(flow, $input);
24
26
 
25
27
  $box : get-span-setting(box-sizing, $input);
26
- $inside : if(get-span-setting(gutter-position, $input) == inside, true, false);
28
+ $inside : if($this-gutter-position == inside or $this-gutter-position == inside-static, true, false);
27
29
 
28
30
  $from : from($this-flow);
29
31
  $context : column-count($this-columns);
@@ -6,22 +6,25 @@
6
6
  // Set gutters on an element.
7
7
  // - [$context] : <settings>
8
8
  @mixin gutters(
9
- $context: get-grid()
9
+ $context: join((of), get-grid())
10
10
  ) {
11
- $context: get-adjusted-grid($context);
11
+ $context : parse-span($context);
12
12
 
13
- $this-columns : get-setting(columns, $context);
14
- $this-gutters : get-setting(gutters, $context);
15
- $this-column-width : get-setting(column-width, $context);
16
- $this-layout-math : get-setting(layout-math, $context);
17
- $this-gutter-position : get-setting(gutter-position, $context);
18
- $this-flow : get-setting(flow, $context);
13
+ $override : get-span-setting(span, $context);
14
+ $this-columns : get-span-setting(columns, $context);
15
+ $this-gutters : get-span-setting(gutters, $context);
16
+ $this-column-width : get-span-setting(column-width, $context);
17
+ $this-layout-math : get-span-setting(layout-math, $context);
18
+ $this-gutter-position : get-span-setting(gutter-position, $context);
19
+ $this-flow : get-span-setting(flow, $context);
19
20
 
20
21
  $from: from($this-flow);
21
22
  $to: to($this-flow);
22
23
 
23
- $this-gutters: get-gutters($this-columns, $this-gutters, $this-column-width, $this-layout-math, $this-gutter-position);
24
- $property: if($this-gutter-position == inside, padding, margin);
24
+ @if $override { $override: if(unitless($override), false, $override); }
25
+
26
+ $this-gutters: get-gutters($this-columns, $this-gutters, $this-column-width, $this-layout-math, $this-gutter-position, $override);
27
+ $property: if($this-gutter-position == inside or $this-gutter-position == inside-static, padding, margin);
25
28
 
26
29
  #{$property}-#{$from}: nth($this-gutters, 1);
27
30
  #{$property}-#{$to}: nth($this-gutters, 2);
@@ -34,17 +37,20 @@
34
37
  @function gutter(
35
38
  $context: get-grid()
36
39
  ) {
37
- $context : get-adjusted-grid($context);
40
+ $context : get-adjusted-grid($context);
38
41
 
39
- $this-columns : get-setting(columns, $context);
40
- $this-gutters : get-setting(gutters, $context);
41
- $this-column-width : get-setting(column-width, $context);
42
- $this-layout-math : get-setting(layout-math, $context);
42
+ $this-columns : get-setting(columns, $context);
43
+ $this-gutters : get-setting(gutters, $context);
44
+ $this-column-width : get-setting(column-width, $context);
45
+ $this-layout-math : get-setting(layout-math, $context);
43
46
  $this-gutter-position : get-setting(gutter-position, $context);
44
47
 
45
- $width: get-gutter-width($this-columns, $this-gutters, $this-column-width, $this-layout-math);
48
+ $this-layout-math: if($this-gutter-position == inside-static, static, $this-layout-math);
49
+ $width: get-gutter-width($this-columns, $this-gutters, $this-column-width, $this-layout-math, $this-gutter-position);
50
+
51
+ $split: if($this-gutter-position == before or $this-gutter-position == after, false, true);
46
52
 
47
- @if $this-gutter-position == inside or $this-gutter-position == split {
53
+ @if $split {
48
54
  $width: $width / 2;
49
55
  }
50
56
 
@@ -59,17 +65,25 @@
59
65
  // - [$column-width] : <length>
60
66
  // - [$layout-math] : fluid | static
61
67
  @function get-gutter-width(
62
- $columns : $columns,
63
- $gutters : $gutters,
64
- $column-width : $column-width,
65
- $layout-math : $layout-math
68
+ $columns : $columns,
69
+ $gutters : $gutters,
70
+ $column-width : $column-width,
71
+ $layout-math : $layout-math,
72
+ $gutter-position : $gutter-position
66
73
  ) {
67
- $context : column-sum($columns, $gutters);
74
+ $context : null;
68
75
  $gutter : null;
69
76
 
77
+ $inside: if($gutter-position == inside or $gutter-position == inside-static, true, false);
78
+
70
79
  @if $layout-math == static {
71
80
  $gutter: $gutters * $column-width;
72
81
  } @else {
82
+ @if $inside {
83
+ $context: column-sum($columns, $gutters, outer);
84
+ } @else {
85
+ $context: column-sum($columns, $gutters);
86
+ }
73
87
  $gutter: percentage($gutters / $context);
74
88
  }
75
89
 
@@ -100,15 +114,16 @@
100
114
  @if $gutter-override {
101
115
  $gutter: $gutter-override;
102
116
  } @else {
103
- $gutter: get-gutter-width($columns, $gutters, $column-width, $layout-math);
117
+ $layout-math: if($gutter-position == inside-static, static, $layout-math);
118
+ $gutter: get-gutter-width($columns, $gutters, $column-width, $layout-math, $gutter-position);
104
119
  }
105
120
 
106
121
  @if $gutter-position == before {
107
122
  $before: $gutter;
108
123
  } @else if $gutter-position == after {
109
124
  $after: $gutter;
110
- } @else if $gutter-position == split or $gutter-position == inside {
111
- $gutter: if($gutter-override, $gutter, $gutter / 2);
125
+ } @else if $gutter-position == split or $gutter-position == inside or $gutter-position == inside-static {
126
+ $gutter: $gutter / 2;
112
127
  $before: $gutter;
113
128
  $after: $gutter;
114
129
  }
@@ -90,3 +90,39 @@
90
90
 
91
91
  @include margin-output($before, $after, $flow);
92
92
  }
93
+
94
+ // Bleed
95
+ // -----
96
+ // Add negative margins, and equal positive padding to create bleed.
97
+ // - $span : <span>
98
+ // - $sides : [ top | right | bottom | left | all ]
99
+ @mixin bleed(
100
+ $span : gutter(),
101
+ $sides : left right
102
+ ) {
103
+ $margin: span(append($span, outer));
104
+ $padding: $margin;
105
+
106
+ $context: get-span-context($span);
107
+
108
+ $this-gutter-position: get-span-setting(gutter-position, $span, parse);
109
+ $inside: if($this-gutter-position == inside or $this-gutter-position == inside-static, true, false);
110
+ $gutter-width: gutter($context);
111
+
112
+ @if $inside and comparable($padding, $gutter-width) {
113
+ $padding: $padding + $gutter-width;
114
+ }
115
+
116
+ @if $box-sizing == border-box { @include box-sizing(content-box); }
117
+
118
+ @if $sides == all {
119
+ margin: 0 - $margin;
120
+ padding: $padding;
121
+ } @else {
122
+ @each $side in $sides {
123
+ margin-#{$side}: 0 - $margin;
124
+ padding-#{$side}: $padding;
125
+ }
126
+ }
127
+ }
128
+
@@ -38,15 +38,15 @@
38
38
  $pre,
39
39
  $post: $pre
40
40
  ) {
41
- $pre : if(index($pre, outer), $pre, append($pre, outer));
42
- $post : if(index($post, outer), $post, append($post, outer));
41
+ $pre : if(index($pre, outer), $pre, append($pre, outer));
42
+ $post : if(index($post, outer), $post, append($post, outer));
43
43
 
44
44
  $get-pre : parse-span($pre);
45
45
  $get-post : parse-span($post);
46
46
 
47
- $flow : get-span-setting(flow, $get-pre);
48
- $before : null;
49
- $after : null;
47
+ $flow : get-span-setting(flow, $get-pre);
48
+ $before : null;
49
+ $after : null;
50
50
 
51
51
  // get the various contexts
52
52
  $default-context : $columns $gutters;
@@ -1,6 +1,8 @@
1
1
  // Span Syntax
2
2
  // ===========
3
3
 
4
+ @import "compass/css3/box-sizing";
5
+
4
6
  // Span [mixin]
5
7
  // ------------
6
8
  // Set a spanning element using shorthand syntax.
@@ -11,7 +13,9 @@
11
13
  $span : parse-span($span);
12
14
  $output : span-math($span...);
13
15
  $box : get-span-setting(box-sizing, $span);
14
- $inside : if(get-span-setting(gutter-position, $span) == inside, true, false);
16
+
17
+ $this-gutter-position: get-span-setting(gutter-position, $span);
18
+ $inside : if($this-gutter-position == inside or $this-gutter-position == inside-static, true, false);
15
19
 
16
20
  @if $box == border-box or $inside {
17
21
  @include box-sizing(border-box);
@@ -20,6 +24,8 @@
20
24
  }
21
25
 
22
26
  @include float-span-output($output...);
27
+
28
+ @include nested($span) { @content; }
23
29
  }
24
30
 
25
31
  // Span [function]
@@ -121,6 +127,8 @@
121
127
  $new-gutter-position: split;
122
128
  } @else if $value == inside {
123
129
  $new-gutter-position: inside;
130
+ } @else if $value == inside-static {
131
+ $new-gutter-position: inside-static;
124
132
  } @else if $value == no-gutter or $value == no-gutters {
125
133
  $new-gutter-position: no-gutters;
126
134
  }
@@ -208,13 +216,15 @@
208
216
  // - $setting : <keyword> (see $options below)
209
217
  // - $span : <span>
210
218
  // - $parse : <boolean>
219
+
220
+ $susy-span-options: span location columns gutters column-width layout-method layout-math outer flow gutter-position is-container gutter-override;
221
+
211
222
  @function get-span-setting(
212
223
  $setting,
213
224
  $span,
214
225
  $parse: false
215
226
  ) {
216
- $options : span location columns gutters column-width layout-method layout-math outer flow gutter-position is-container gutter-override;
217
- $key : index($options, $setting);
227
+ $key : index($susy-span-options, $setting);
218
228
  $value : false;
219
229
 
220
230
  @if $parse {
@@ -255,7 +265,8 @@
255
265
  $flow : $flow,
256
266
  $gutter-position : $gutter-position,
257
267
  $is-container : false,
258
- $gutter-override : false
268
+ $gutter-override : false,
269
+ $last-flow : $last-flow
259
270
  ) {
260
271
  $float : from;
261
272
  $width : $span;
@@ -269,11 +280,15 @@
269
280
  $width: get-span-width($span, $location, $columns, $gutters, $column-width, $layout-math, $gutter-position, $outer);
270
281
  $this-gutters: get-gutters($columns, $gutters, $column-width, $layout-math, $gutter-position, $gutter-override);
271
282
 
283
+ $inside: if($gutter-position == inside or $gutter-position == inside-static, true, false);
284
+
272
285
  // apply gutters
273
- @if $gutter-position == inside and not $is-container {
274
- $padding-before: nth($this-gutters,1);
275
- $padding-after: nth($this-gutters,2);
276
- } @else if $gutter-position != inside {
286
+ @if $inside {
287
+ @if not $is-container {
288
+ $padding-before: nth($this-gutters,1);
289
+ $padding-after: nth($this-gutters,2);
290
+ }
291
+ } @else {
277
292
  $margin-before: nth($this-gutters,1);
278
293
  $margin-after: nth($this-gutters,2);
279
294
  }
@@ -284,7 +299,7 @@
284
299
  $margin-after: -100%;
285
300
  } @else {
286
301
  @if is-last($span, $location, $columns) {
287
- $float: to;
302
+ $float: $last-flow;
288
303
  $margin-after: null;
289
304
  } @else if is-first($location) {
290
305
  $margin-before: null;
@@ -319,8 +334,10 @@
319
334
  $span-sum : null;
320
335
  $width : null;
321
336
 
337
+ $inside: if($gutter-position == inside or $gutter-position == inside-static, true, false);
338
+
322
339
  @if unitless($span) {
323
- @if $gutter-position == inside {
340
+ @if $inside {
324
341
  $context: column-sum($columns, $gutters, outer);
325
342
  $span-sum: get-column-span-sum($span, $location, $columns, $gutters, outer);
326
343
  } @else {
@@ -339,3 +356,34 @@
339
356
 
340
357
  @return $width;
341
358
  }
359
+
360
+ // Get Span Context
361
+ // ----------------
362
+ // - $span: <span>
363
+ @function get-span-context(
364
+ $span
365
+ ) {
366
+ $parsed: parse-span($span);
367
+ $context: compact();
368
+
369
+ $width: get-span-setting(span, $parsed);
370
+ $location: get-span-setting(location, $parsed);
371
+
372
+ $removed-width: false;
373
+ $removed-location: false;
374
+
375
+ @each $setting in $span {
376
+ @if $setting != of and $setting != at {
377
+ @if $setting == $width and not $removed-width {
378
+ $removed-width: true;
379
+ } @else if $setting == $location and not $removed-location {
380
+ $removed-location: true;
381
+ } @else {
382
+ $context: append($context, $setting, space);
383
+ }
384
+ }
385
+ }
386
+
387
+ @return $context;
388
+ }
389
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: susy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha.3
4
+ version: 2.0.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Meyer
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-07-09 00:00:00 Z
19
+ date: 2013-09-04 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: compass
@@ -70,8 +70,8 @@ files:
70
70
  - sass/susy/api/float/_end.scss
71
71
  - sass/susy/api/float/_isolate.scss
72
72
  - sass/susy/api/float/_span.scss
73
+ - sass/susy/api/shared/_background.scss
73
74
  - sass/susy/api/shared/_container.scss
74
- - sass/susy/api/shared/_grid-background.scss
75
75
  - sass/susy/api/shared/_margins.scss
76
76
  - sass/susy/api/shared/_padding.scss
77
77
  - sass/susy/helpers/_direction.scss