susy 2.2.0.beta.2 → 2.2.0.beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/docs/changelog.rst +5 -0
- data/sass/susy/language/susy/_breakpoint-plugin.scss +131 -5
- data/sass/susy/output/_support.scss +1 -1
- data/sass/susy/output/support/_support.scss +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360d88c3ff882b9046a62354b8e152bdedf3b970
|
4
|
+
data.tar.gz: 5869cbf765871085cc6cf46d46f69a5a7933dc4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc1c83c77df18ff1287003fa7b9cbb93784a4e2a010810cd8d1d3a93e768731539e633b5a3da1fc287d05a6a3554391cfdf6715040f97075ef43051c0265d79
|
7
|
+
data.tar.gz: ebb8a4311e7f23bfeb7145eef1991c4aeda8e03ccd4861135f6ae46713a6f87aec050cebcc5887a5e51db63f8c1460f719ab6b3c6bf7574ee29a9d78aca57a49
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.0.beta.
|
1
|
+
2.2.0.beta.2
|
data/docs/changelog.rst
CHANGED
@@ -4,6 +4,11 @@ Changelog
|
|
4
4
|
2.2.0 - UNRELEASED
|
5
5
|
------------------
|
6
6
|
|
7
|
+
- Add global ``$susy-breakpoints`` map for creating named breakpoints.
|
8
|
+
- Add internal media-query support for ``susy-breakpoint``
|
9
|
+
without requiring the Breakpoint plugin.
|
10
|
+
- ``susy-breakpoint`` mixin no longer requires ``$layout`` argument.
|
11
|
+
By default, no changes will be made to your existing layout.
|
7
12
|
- Update ``global-box-sizing`` and the legacy ``border-box-sizing``
|
8
13
|
mixins to optionally take another argument, ``$inherit``. This new
|
9
14
|
argument is a boolean value that defaults to ``false``, meaning the
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// Breakpoint Integration
|
2
2
|
// ======================
|
3
|
-
|
3
|
+
|
4
|
+
$susy-breakpoints: ();
|
4
5
|
|
5
6
|
|
6
7
|
// Susy Breakpoint
|
@@ -11,16 +12,141 @@
|
|
11
12
|
// - $no-query : <breakpoint $no-query>
|
12
13
|
@mixin susy-breakpoint(
|
13
14
|
$query,
|
14
|
-
$layout,
|
15
|
+
$layout: false,
|
15
16
|
$no-query: false
|
16
17
|
) {
|
17
|
-
@
|
18
|
-
@
|
18
|
+
@include susy-mq($query, $no-query) {
|
19
|
+
@if $layout {
|
19
20
|
@include with-layout($layout) {
|
20
21
|
@content;
|
21
22
|
}
|
23
|
+
} @else {
|
24
|
+
@content;
|
22
25
|
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
// Media Queries
|
30
|
+
// -------------
|
31
|
+
// Check for an existing breakpoint mixin, or provide a simple fallback.
|
32
|
+
// - $query: <min-width> [<max-width>] | <property> <value>
|
33
|
+
// - $no-query: <boolean> | <selector>
|
34
|
+
@mixin susy-mq(
|
35
|
+
$query,
|
36
|
+
$no-query: false
|
37
|
+
) {
|
38
|
+
@if susy-support(breakpoint, (mixin: breakpoint), $warn: false) {
|
39
|
+
@include breakpoint($query, $no-query);
|
23
40
|
} @else {
|
24
|
-
@
|
41
|
+
@media #{susy-build-breakpoint($query)} {
|
42
|
+
@content;
|
43
|
+
}
|
44
|
+
|
45
|
+
@if $no-query {
|
46
|
+
@if type-of($no-query) == string {
|
47
|
+
#{$no-query} & {
|
48
|
+
@content;
|
49
|
+
}
|
50
|
+
} @else {
|
51
|
+
@content;
|
52
|
+
}
|
53
|
+
}
|
25
54
|
}
|
26
55
|
}
|
56
|
+
|
57
|
+
|
58
|
+
// Get Media
|
59
|
+
// ---------
|
60
|
+
// Return a named media-query from $susy-breakpoints.
|
61
|
+
// - $name: <key>
|
62
|
+
@function susy-get-media(
|
63
|
+
$name
|
64
|
+
) {
|
65
|
+
$query: map-get($susy-breakpoints, $name);
|
66
|
+
|
67
|
+
@if map-has-key($susy-breakpoints, $query) {
|
68
|
+
$query: susy-get-media($query);
|
69
|
+
}
|
70
|
+
|
71
|
+
@if not($query) {
|
72
|
+
@warn '"#{$name}" is not an option in $susy-breakpoints.';
|
73
|
+
}
|
74
|
+
|
75
|
+
@return $query;
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
// Parse Breakpoint
|
80
|
+
// ----------------
|
81
|
+
// Return a formatted media-query
|
82
|
+
// - $query: <min-width> [<max-width>] | <property> <value>
|
83
|
+
@function susy-parse-breakpoint(
|
84
|
+
$query
|
85
|
+
) {
|
86
|
+
$output: (
|
87
|
+
min-width: null,
|
88
|
+
max-width: null,
|
89
|
+
);
|
90
|
+
|
91
|
+
@if type-of($query) == map {
|
92
|
+
@return $query;
|
93
|
+
} @else if map-has-key($susy-breakpoints, $query) {
|
94
|
+
@return susy-parse-breakpoint(susy-get-media($query));
|
95
|
+
}
|
96
|
+
|
97
|
+
$i: 1;
|
98
|
+
@while $i <= length($query) {
|
99
|
+
$this: nth($query, $i);
|
100
|
+
|
101
|
+
@if type-of($this) == map {
|
102
|
+
$output: map-merge($output, $this);
|
103
|
+
} @else if type-of($this) == string {
|
104
|
+
$i: $i + 1;
|
105
|
+
@if $i > length($query) {
|
106
|
+
@warn 'No value supplied for #{$this}';
|
107
|
+
} @else {
|
108
|
+
$value: nth($query, $i);
|
109
|
+
$output: map-merge($output, ($this: $value));
|
110
|
+
}
|
111
|
+
} @else if type-of($this) == list {
|
112
|
+
$prop: nth($this, 1);
|
113
|
+
$value: nth($this, 2);
|
114
|
+
$output: map-merge($output, ($prop: $value));
|
115
|
+
} @else if type-of($this) == number {
|
116
|
+
$prop: null;
|
117
|
+
@each $key, $value in $output {
|
118
|
+
@if not($value) and not($prop) {
|
119
|
+
$prop: $key;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
$output: map-merge($output, ($prop: $this));
|
123
|
+
}
|
124
|
+
|
125
|
+
$i: $i + 1;
|
126
|
+
}
|
127
|
+
|
128
|
+
@return $output;
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
// Build Breakpoint
|
133
|
+
// ----------------
|
134
|
+
|
135
|
+
@function susy-build-breakpoint(
|
136
|
+
$query
|
137
|
+
) {
|
138
|
+
$query: susy-parse-breakpoint($query);
|
139
|
+
$return: null;
|
140
|
+
|
141
|
+
@each $prop, $value in $query {
|
142
|
+
@if $value {
|
143
|
+
@if $return {
|
144
|
+
$return: '#{$return} and (#{$prop}: #{$value})';
|
145
|
+
} @else {
|
146
|
+
$return: '(#{$prop}: #{$value})';
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
@return $return;
|
152
|
+
}
|