susy 2.0.0.beta.1 → 2.0.0.beta.2
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/docs/changelog.rst +42 -1
- data/sass/susy/_math.scss +0 -1
- data/sass/susy/language/_shared.scss +4 -0
- data/sass/susy/language/_susy.scss +3 -1
- data/sass/susy/language/shared/_maps.scss +85 -0
- data/sass/susy/language/susy/_background.scss +59 -45
- data/sass/susy/language/susy/_bleed.scss +150 -29
- data/sass/susy/language/susy/_breakpoint-plugin.scss +1 -1
- data/sass/susy/language/susy/_container.scss +21 -21
- data/sass/susy/language/susy/_context.scss +5 -5
- data/sass/susy/language/susy/_gallery.scss +20 -20
- data/sass/susy/language/susy/_grids.scss +15 -25
- data/sass/susy/language/susy/_gutters.scss +14 -14
- data/sass/susy/language/susy/_isolate.scss +31 -9
- data/sass/susy/language/susy/_margins.scss +14 -4
- data/sass/susy/language/susy/_padding.scss +14 -4
- data/sass/susy/language/susy/_rows.scss +19 -16
- data/sass/susy/language/susy/_settings.scss +40 -14
- data/sass/susy/language/susy/_span.scss +5 -2
- data/sass/susy/math/_columns.scss +8 -8
- data/sass/susy/math/_settings.scss +1 -2
- data/sass/susy/math/_validation.scss +0 -16
- data/sass/susy/{api → output}/_float.scss +0 -0
- data/sass/susy/{api → output}/_shared.scss +0 -0
- data/sass/susy/{api → output}/float/_clearfix.scss +0 -0
- data/sass/susy/{api → output}/float/_container.scss +0 -0
- data/sass/susy/{api → output}/float/_end.scss +0 -0
- data/sass/susy/{api → output}/float/_isolate.scss +0 -0
- data/sass/susy/{api → output}/float/_span.scss +0 -0
- data/sass/susy/{api → output}/shared/_background.scss +0 -0
- data/sass/susy/{api → output}/shared/_box-sizing.scss +0 -0
- data/sass/susy/{api → output}/shared/_container.scss +0 -0
- data/sass/susy/{api → output}/shared/_direction.scss +0 -0
- data/sass/susy/{api → output}/shared/_margins.scss +0 -0
- data/sass/susy/{api → output}/shared/_padding.scss +0 -0
- metadata +16 -16
- data/sass/susy/_helpers.scss +0 -6
- data/sass/susy/math/_container.scss +0 -20
@@ -4,54 +4,54 @@
|
|
4
4
|
// Container [mixin]
|
5
5
|
// -----------------
|
6
6
|
// Set a container element
|
7
|
-
// - [$
|
7
|
+
// - [$layout] : <settings>
|
8
8
|
@mixin container(
|
9
|
-
$
|
9
|
+
$layout: $susy
|
10
10
|
) {
|
11
|
-
$
|
11
|
+
$layout : parse-grid($layout);
|
12
12
|
|
13
|
-
$width : get-container-width($
|
14
|
-
$justify : parse-container-position(susy-get(container-position, $
|
15
|
-
$property : if(susy-get(math, $
|
13
|
+
$width : get-container-width($layout);
|
14
|
+
$justify : parse-container-position(susy-get(container-position, $layout));
|
15
|
+
$property : if(susy-get(math, $layout) == static, width, max-width);
|
16
16
|
|
17
|
-
$box : susy-get(box-sizing, $
|
17
|
+
$box : susy-get(box-sizing, $layout);
|
18
18
|
|
19
19
|
@if $box {
|
20
20
|
@include susy-box-sizing($box);
|
21
21
|
}
|
22
22
|
|
23
23
|
@include float-container($width, $justify, $property);
|
24
|
-
@include show-grid($
|
24
|
+
@include show-grid($layout);
|
25
25
|
}
|
26
26
|
|
27
27
|
// Container [function]
|
28
28
|
// --------------------
|
29
29
|
// Return container width
|
30
|
-
// - [$
|
30
|
+
// - [$layout] : <settings>
|
31
31
|
@function container(
|
32
|
-
$
|
32
|
+
$layout: $susy
|
33
33
|
) {
|
34
|
-
$
|
35
|
-
@return get-container-width($
|
34
|
+
$layout: parse-grid($layout);
|
35
|
+
@return get-container-width($layout);
|
36
36
|
}
|
37
37
|
|
38
38
|
// Get Container Width
|
39
39
|
// -------------------
|
40
40
|
// Calculate the container width
|
41
|
-
// - [$
|
41
|
+
// - [$layout]: <settings>
|
42
42
|
@function get-container-width(
|
43
|
-
$
|
43
|
+
$layout: $susy
|
44
44
|
) {
|
45
|
-
$
|
46
|
-
$width : susy-get(container, $
|
47
|
-
$column-width : susy-get(column-width, $
|
45
|
+
$layout : parse-grid($layout);
|
46
|
+
$width : susy-get(container, $layout);
|
47
|
+
$column-width : susy-get(column-width, $layout);
|
48
48
|
|
49
49
|
@if not $width or $width == auto {
|
50
50
|
@if $column-width {
|
51
|
-
$columns : susy-get(columns, $
|
52
|
-
$gutters : susy-get(gutters, $
|
53
|
-
$spread : if(is-split($
|
54
|
-
$width :
|
51
|
+
$columns : susy-get(columns, $layout);
|
52
|
+
$gutters : susy-get(gutters, $layout);
|
53
|
+
$spread : if(is-split($layout), wide, narrow);
|
54
|
+
$width : column-sum($columns, $gutters, $spread) * $column-width;
|
55
55
|
} @else {
|
56
56
|
// if we have nothing, default to 100%
|
57
57
|
$width: 100%;
|
@@ -13,7 +13,7 @@
|
|
13
13
|
$location : get-location($context);
|
14
14
|
$columns : susy-get(columns, $context);
|
15
15
|
|
16
|
-
@return
|
16
|
+
@return column-span($span, $location, $columns);
|
17
17
|
}
|
18
18
|
|
19
19
|
// Nested [mixin]
|
@@ -24,11 +24,11 @@
|
|
24
24
|
@mixin nested(
|
25
25
|
$context
|
26
26
|
) {
|
27
|
-
$context
|
28
|
-
$old
|
29
|
-
$susy
|
27
|
+
$context : parse-span($context);
|
28
|
+
$old : susy-get(columns);
|
29
|
+
$susy : map-merge($susy, (columns: nested($context))) !global;
|
30
30
|
|
31
31
|
@content;
|
32
32
|
|
33
|
-
$susy
|
33
|
+
$susy : map-merge($susy, (columns: $old)) !global;
|
34
34
|
}
|
@@ -4,23 +4,23 @@
|
|
4
4
|
// Gallery
|
5
5
|
// -------
|
6
6
|
// Create an isolated gallery
|
7
|
-
// - $
|
7
|
+
// - $span : <span>
|
8
8
|
// - [$selector] : child | of-type
|
9
9
|
@mixin gallery(
|
10
|
-
$
|
10
|
+
$span,
|
11
11
|
$selector: child
|
12
12
|
) {
|
13
|
-
$
|
14
|
-
$
|
13
|
+
$span : parse-span($span);
|
14
|
+
$span : map-merge($span, (location: 1));
|
15
15
|
|
16
|
-
$
|
17
|
-
$columns : susy-get(columns, $
|
16
|
+
$n : susy-get(span, $span);
|
17
|
+
$columns : susy-get(columns, $span);
|
18
18
|
$context : column-count($columns);
|
19
|
-
$flow : susy-get(flow, $
|
19
|
+
$flow : susy-get(flow, $span);
|
20
20
|
|
21
|
-
$inside : is-inside($
|
21
|
+
$inside : is-inside($span);
|
22
22
|
$from : from($flow);
|
23
|
-
$line : floor($context / $
|
23
|
+
$line : floor($context / $n);
|
24
24
|
$symmetrical : is-symmetrical($columns);
|
25
25
|
|
26
26
|
$output: (
|
@@ -34,7 +34,7 @@
|
|
34
34
|
);
|
35
35
|
|
36
36
|
@if $inside {
|
37
|
-
$gutters: get-gutters($
|
37
|
+
$gutters: get-gutters($span);
|
38
38
|
$output: map-merge($output, (
|
39
39
|
padding_before: map-get($gutters, before),
|
40
40
|
padding_after: map-get($gutters, after),
|
@@ -42,10 +42,10 @@
|
|
42
42
|
}
|
43
43
|
|
44
44
|
@if $symmetrical {
|
45
|
-
$output: map-merge($output, (width: get-span-width($
|
45
|
+
$output: map-merge($output, (width: get-span-width($span)));
|
46
46
|
}
|
47
47
|
|
48
|
-
$box : susy-get(box-sizing, $
|
48
|
+
$box : susy-get(box-sizing, $span);
|
49
49
|
$global-box : if(susy-get(global-box-sizing) == 'border-box', true, false);
|
50
50
|
|
51
51
|
// Collective Output
|
@@ -59,13 +59,13 @@
|
|
59
59
|
|
60
60
|
// Individual Loop
|
61
61
|
@for $item from 1 through $line {
|
62
|
-
$
|
63
|
-
&:nth-#{$selector}(#{$
|
62
|
+
$nth: '#{$line}n + #{$item}';
|
63
|
+
&:nth-#{$selector}(#{$nth}) {
|
64
64
|
// Individual Prep
|
65
65
|
$output: (
|
66
|
-
width : if($symmetrical, null, get-span-width($
|
66
|
+
width : if($symmetrical, null, get-span-width($span)),
|
67
67
|
float : null,
|
68
|
-
margin_before : get-isolation($
|
68
|
+
margin_before : get-isolation($span),
|
69
69
|
margin_after : -100%,
|
70
70
|
padding_before : null,
|
71
71
|
padding_after : null,
|
@@ -75,17 +75,17 @@
|
|
75
75
|
// Individual Output
|
76
76
|
@include float-span-output($output...);
|
77
77
|
|
78
|
-
@if get-edge($
|
78
|
+
@if get-edge($span) == first {
|
79
79
|
@include break;
|
80
|
-
@include first($
|
80
|
+
@include first($span);
|
81
81
|
} @else {
|
82
82
|
@include nobreak;
|
83
83
|
}
|
84
84
|
|
85
85
|
// Individual Location Increment
|
86
|
-
$location: get-location($
|
86
|
+
$location: get-location($span) + $n;
|
87
87
|
$location: if($location > $context, 1, $location);
|
88
|
-
$
|
88
|
+
$span: map-merge($span, (location: $location));
|
89
89
|
}
|
90
90
|
}
|
91
91
|
}
|
@@ -1,36 +1,26 @@
|
|
1
1
|
// Grid Syntax
|
2
2
|
// ===========
|
3
3
|
|
4
|
-
//
|
5
|
-
//
|
6
|
-
// Set a new
|
7
|
-
// - $
|
8
|
-
@mixin
|
9
|
-
$
|
10
|
-
) {
|
11
|
-
$susy: map-merge($susy, parse-grid($grid)) !global;
|
12
|
-
}
|
13
|
-
|
14
|
-
// Susy Set
|
15
|
-
// --------
|
16
|
-
// Change one setting
|
17
|
-
@mixin susy-set(
|
18
|
-
$key,
|
19
|
-
$value
|
4
|
+
// Layout
|
5
|
+
// ------
|
6
|
+
// Set a new layout using a shorthand
|
7
|
+
// - $layout: <settings>
|
8
|
+
@mixin layout(
|
9
|
+
$layout
|
20
10
|
) {
|
21
|
-
$susy: map-merge($susy, ($
|
11
|
+
$susy: map-merge($susy, parse-grid($layout)) !global;
|
22
12
|
}
|
23
13
|
|
24
14
|
// Use Grid
|
25
15
|
// --------
|
26
|
-
// Use an arbitrary
|
27
|
-
// - $
|
28
|
-
@mixin
|
29
|
-
$
|
16
|
+
// Use an arbitrary layout for a section of code
|
17
|
+
// - $layout: <settings>
|
18
|
+
@mixin with-layout(
|
19
|
+
$layout
|
30
20
|
) {
|
31
21
|
$old: $susy;
|
32
22
|
|
33
|
-
@include
|
23
|
+
@include layout($layout);
|
34
24
|
@content;
|
35
25
|
|
36
26
|
$susy: $old !global;
|
@@ -39,9 +29,9 @@
|
|
39
29
|
// Layout
|
40
30
|
// ------
|
41
31
|
// Return a parsed layout map based on shorthand syntax
|
42
|
-
// - $
|
32
|
+
// - $layout: <settings>
|
43
33
|
@function layout(
|
44
|
-
$
|
34
|
+
$layout: $susy
|
45
35
|
) {
|
46
|
-
@return parse-grid($
|
36
|
+
@return parse-grid($layout);
|
47
37
|
}
|
@@ -4,19 +4,19 @@
|
|
4
4
|
// Gutters
|
5
5
|
// -------
|
6
6
|
// Set gutters on an element.
|
7
|
-
// - [$
|
7
|
+
// - [$span] : <settings>
|
8
8
|
@mixin gutters(
|
9
|
-
$
|
9
|
+
$span: $susy
|
10
10
|
) {
|
11
|
-
$
|
12
|
-
$gutters : get-gutters($
|
11
|
+
$span : parse-gutters($span);
|
12
|
+
$gutters : get-gutters($span);
|
13
13
|
$output : (
|
14
14
|
before: map-get($gutters, before),
|
15
15
|
after: map-get($gutters, after),
|
16
|
-
flow: susy-get(flow, $
|
16
|
+
flow: susy-get(flow, $span),
|
17
17
|
);
|
18
18
|
|
19
|
-
@if is-inside($
|
19
|
+
@if is-inside($span) {
|
20
20
|
@include padding-output($output...);
|
21
21
|
} @else {
|
22
22
|
@include margin-output($output...);
|
@@ -24,30 +24,30 @@
|
|
24
24
|
}
|
25
25
|
|
26
26
|
@mixin gutter(
|
27
|
-
$
|
27
|
+
$span: $susy
|
28
28
|
) {
|
29
|
-
@include gutters($
|
29
|
+
@include gutters($span);
|
30
30
|
}
|
31
31
|
|
32
32
|
// Gutter
|
33
33
|
// ------
|
34
34
|
// Return the width of a gutter.
|
35
|
-
// - [$
|
35
|
+
// - [$span] : <settings>
|
36
36
|
@function gutter(
|
37
|
-
$
|
37
|
+
$span: $susy
|
38
38
|
) {
|
39
|
-
$
|
39
|
+
$span: parse-gutters($span);
|
40
40
|
|
41
|
-
$gutters: get-gutters($
|
41
|
+
$gutters: get-gutters($span);
|
42
42
|
$gutters: map-get($gutters, before) or map-get($gutters, after);
|
43
43
|
|
44
44
|
@return $gutters;
|
45
45
|
}
|
46
46
|
|
47
47
|
@function gutters(
|
48
|
-
$
|
48
|
+
$span: $susy
|
49
49
|
) {
|
50
|
-
@return gutter($
|
50
|
+
@return gutter($span);
|
51
51
|
}
|
52
52
|
|
53
53
|
// Get Gutter Width
|
@@ -1,22 +1,45 @@
|
|
1
1
|
// Isolation Syntax
|
2
2
|
// ================
|
3
3
|
|
4
|
-
|
5
|
-
//
|
4
|
+
|
5
|
+
// Isolate [Mixin]
|
6
|
+
// ---------------
|
6
7
|
// Set isolation as an override.
|
7
|
-
// - $
|
8
|
+
// - $location: <span>
|
8
9
|
@mixin isolate(
|
9
|
-
$
|
10
|
+
$isolate: 1
|
10
11
|
) {
|
11
|
-
$
|
12
|
-
|
13
|
-
|
14
|
-
flow: susy-get(flow, $input),
|
12
|
+
$output: (
|
13
|
+
push: isolate($isolate),
|
14
|
+
flow: susy-get(flow, $isolate),
|
15
15
|
);
|
16
16
|
|
17
17
|
@include isolate-output($output...);
|
18
18
|
}
|
19
19
|
|
20
|
+
|
21
|
+
// Isolate [function]
|
22
|
+
// ------------------
|
23
|
+
// Return an isolation offset width.
|
24
|
+
// - $location: <span>
|
25
|
+
@function isolate(
|
26
|
+
$isolate: 1
|
27
|
+
) {
|
28
|
+
$isolate: parse-span($isolate);
|
29
|
+
$isolation: susy-get(span, $isolate);
|
30
|
+
|
31
|
+
@if $isolation and not get-location($isolate) {
|
32
|
+
$new: (
|
33
|
+
span: null,
|
34
|
+
location: $isolation,
|
35
|
+
);
|
36
|
+
$isolate: map-merge($isolate, $new);
|
37
|
+
}
|
38
|
+
|
39
|
+
@return get-isolation($isolate);
|
40
|
+
}
|
41
|
+
|
42
|
+
|
20
43
|
// Get Isolation
|
21
44
|
// -------------
|
22
45
|
// Return the isolation offset width
|
@@ -24,7 +47,6 @@
|
|
24
47
|
@function get-isolation(
|
25
48
|
$input
|
26
49
|
) {
|
27
|
-
$span : susy-get(span, $input);
|
28
50
|
$location : get-location($input);
|
29
51
|
$columns : susy-get(columns, $input);
|
30
52
|
$width : null;
|
@@ -63,11 +63,21 @@
|
|
63
63
|
// - [$post] : <span>
|
64
64
|
@mixin squish(
|
65
65
|
$pre,
|
66
|
-
$post:
|
66
|
+
$post: false
|
67
67
|
) {
|
68
|
-
$pre
|
69
|
-
|
70
|
-
$post
|
68
|
+
$pre: map-merge((spread: wide), parse-span($pre));
|
69
|
+
|
70
|
+
@if $post {
|
71
|
+
$post: map-merge((spread: wide), parse-span($post));
|
72
|
+
} @else {
|
73
|
+
$span: susy-get(span, $pre);
|
74
|
+
@if length($span) > 1 {
|
75
|
+
$pre: map-merge($pre, (span: nth($span, 1)));
|
76
|
+
$post: map-merge($pre, (span: nth($span, 2)));
|
77
|
+
} @else {
|
78
|
+
$post: $pre;
|
79
|
+
}
|
80
|
+
}
|
71
81
|
|
72
82
|
@include pre($pre);
|
73
83
|
@include post($post);
|
@@ -46,11 +46,21 @@
|
|
46
46
|
// - [$post] : <span>
|
47
47
|
@mixin pad(
|
48
48
|
$pre,
|
49
|
-
$post:
|
49
|
+
$post: false
|
50
50
|
) {
|
51
|
-
$pre
|
52
|
-
|
53
|
-
$post
|
51
|
+
$pre: map-merge((spread: wide), parse-span($pre));
|
52
|
+
|
53
|
+
@if $post {
|
54
|
+
$post: map-merge((spread: wide), parse-span($post));
|
55
|
+
} @else {
|
56
|
+
$span: susy-get(span, $pre);
|
57
|
+
@if length($span) > 1 {
|
58
|
+
$pre: map-merge($pre, (span: nth($span, 1)));
|
59
|
+
$post: map-merge($pre, (span: nth($span, 2)));
|
60
|
+
} @else {
|
61
|
+
$post: $pre;
|
62
|
+
}
|
63
|
+
}
|
54
64
|
|
55
65
|
@include prefix($pre);
|
56
66
|
@include suffix($post);
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
// Full
|
22
22
|
// ----
|
23
|
-
// - [$
|
23
|
+
// - [$context]: <layout shorthand>
|
24
24
|
@mixin full(
|
25
25
|
$context: $susy
|
26
26
|
) {
|
@@ -30,44 +30,44 @@
|
|
30
30
|
|
31
31
|
// First
|
32
32
|
// -----
|
33
|
-
// - [$
|
33
|
+
// - [$context]: <settings>
|
34
34
|
@mixin first(
|
35
|
-
$
|
35
|
+
$context: $susy
|
36
36
|
) {
|
37
|
-
$
|
38
|
-
$flow: susy-get(flow, $
|
37
|
+
$context: parse-grid($context);
|
38
|
+
$flow: susy-get(flow, $context);
|
39
39
|
|
40
|
-
@if not is-split($
|
40
|
+
@if not is-split($context) {
|
41
41
|
@include float-first($flow);
|
42
42
|
}
|
43
43
|
}
|
44
44
|
|
45
45
|
@mixin alpha(
|
46
|
-
$
|
46
|
+
$context: $susy
|
47
47
|
) {
|
48
|
-
@include first($
|
48
|
+
@include first($context);
|
49
49
|
}
|
50
50
|
|
51
51
|
|
52
52
|
// Last
|
53
53
|
// ----
|
54
|
-
// - [$
|
54
|
+
// - [$context]: <settings>
|
55
55
|
@mixin last(
|
56
|
-
$
|
56
|
+
$context: $susy
|
57
57
|
) {
|
58
|
-
$
|
58
|
+
$context: parse-grid($context);
|
59
59
|
$output: (
|
60
|
-
flow: susy-get(flow, $
|
61
|
-
margin: if(is-split($
|
60
|
+
flow: susy-get(flow, $context),
|
61
|
+
margin: if(is-split($context), null, 0),
|
62
62
|
);
|
63
63
|
|
64
64
|
@include float-last($output...);
|
65
65
|
}
|
66
66
|
|
67
67
|
@mixin omega(
|
68
|
-
$
|
68
|
+
$context: $susy
|
69
69
|
) {
|
70
|
-
@include last($
|
70
|
+
@include last($context);
|
71
71
|
}
|
72
72
|
|
73
73
|
|
@@ -85,9 +85,12 @@
|
|
85
85
|
$location: susy-get(location, $span);
|
86
86
|
$n: susy-get(span, $span);
|
87
87
|
|
88
|
+
$number: if(type-of($location) == number, true, false);
|
89
|
+
$index: if($number and unitless($location), true, false);
|
90
|
+
|
88
91
|
@if $n == $count {
|
89
92
|
$edge: full;
|
90
|
-
} @else if $location {
|
93
|
+
} @else if $location and $n and $index {
|
91
94
|
@if $location == 1 {
|
92
95
|
$edge: if($n == $count, full, first);
|
93
96
|
} @else if $location + $n - 1 == $count {
|