susy 2.2.0.rc.2 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/VERSION +1 -1
- data/docs/changelog.rst +4 -3
- data/sass/susy/language/susy/_breakpoint-plugin.scss +115 -88
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeff89a5dbdfc5672ff554689e6afbcdaa724e45
|
4
|
+
data.tar.gz: 9be2961b9570ce56d91f8989427a9b8be393caf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2770325f1fcede0dd34d97ae023c524cfb379b9dbc24c01e145320615dcbb4cd2f0e9ee09b8ff75e750d9173bb76954ff322d13864efff92c3378d3b493689cd
|
7
|
+
data.tar.gz: e36108df39a377d723e61895b5bd1989e0b99c63378abfa5416aab6530ae1f1eb96dc967f78079f37179dc23a37cb45af0d5cf650a870be0e165f1d9d8a6d6f0
|
data/LICENSE.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.0
|
1
|
+
2.2.0
|
data/docs/changelog.rst
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
2.2.
|
5
|
-
|
4
|
+
2.2.1 - Jan 14 2015
|
5
|
+
-------------------
|
6
6
|
|
7
|
-
-
|
7
|
+
- Release npm ``susy`` package.
|
8
|
+
- Add global ``$susy-media`` map for creating named breakpoints.
|
8
9
|
- Add internal media-query support for ``susy-breakpoint``
|
9
10
|
without requiring the Breakpoint plugin.
|
10
11
|
- ``susy-breakpoint`` mixin no longer requires ``$layout`` argument.
|
@@ -1,21 +1,24 @@
|
|
1
1
|
// Breakpoint Integration
|
2
2
|
// ======================
|
3
3
|
|
4
|
-
$susy-
|
4
|
+
$susy-media: () !default;
|
5
|
+
$susy-media-fallback: false !default;
|
6
|
+
|
7
|
+
$_susy-media-context: ();
|
5
8
|
|
6
9
|
|
7
10
|
// Susy Breakpoint
|
8
11
|
// ---------------
|
9
|
-
// Change grids at different
|
10
|
-
// - $query : <
|
12
|
+
// Change grids at different media query breakpoints.
|
13
|
+
// - $query : <min-width> [<max-width>] | <property> <value> | <map>
|
11
14
|
// - $layout : <settings>
|
12
|
-
// - $no-query : <
|
15
|
+
// - $no-query : <boolean> | <selector>
|
13
16
|
@mixin susy-breakpoint(
|
14
17
|
$query,
|
15
18
|
$layout: false,
|
16
|
-
$no-query:
|
19
|
+
$no-query: $susy-media-fallback
|
17
20
|
) {
|
18
|
-
@include susy-
|
21
|
+
@include susy-media-router($query, $no-query) {
|
19
22
|
@if $layout {
|
20
23
|
@include with-layout($layout) {
|
21
24
|
@content;
|
@@ -26,129 +29,153 @@ $susy-breakpoints: ();
|
|
26
29
|
}
|
27
30
|
}
|
28
31
|
|
29
|
-
|
30
|
-
//
|
31
|
-
//
|
32
|
+
|
33
|
+
// Susy Media
|
34
|
+
// ----------
|
32
35
|
// - $query: <min-width> [<max-width>] | <property> <value>
|
33
36
|
// - $no-query: <boolean> | <selector>
|
34
|
-
@mixin susy-
|
37
|
+
@mixin susy-media(
|
38
|
+
$query,
|
39
|
+
$no-query: $susy-media-fallback
|
40
|
+
) {
|
41
|
+
$old-context: $_susy-media-context;
|
42
|
+
$name: if(map-has-key($susy-media, $query), $query, null);
|
43
|
+
$query: susy-get-media($query);
|
44
|
+
$query: susy-parse-media($query);
|
45
|
+
|
46
|
+
@include susy-media-context($query, $name);
|
47
|
+
|
48
|
+
@if $no-query and type-of($no-query) != string {
|
49
|
+
@content;
|
50
|
+
} @else {
|
51
|
+
@media #{susy-render-media($query)} {
|
52
|
+
@content;
|
53
|
+
}
|
54
|
+
|
55
|
+
@if type-of($no-query) == string {
|
56
|
+
#{$no-query} & {
|
57
|
+
@content;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
@include susy-media-context($old-context, $clean: true);
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
// Media Router
|
67
|
+
// ------------
|
68
|
+
// Rout media arguments to the correct mixin.
|
69
|
+
@mixin susy-media-router(
|
35
70
|
$query,
|
36
|
-
$no-query:
|
71
|
+
$no-query: $susy-media-fallback
|
37
72
|
) {
|
38
73
|
@if susy-support(breakpoint, (mixin: breakpoint), $warn: false) {
|
39
74
|
@include breakpoint($query, $no-query) {
|
40
75
|
@content;
|
41
76
|
}
|
42
77
|
} @else {
|
43
|
-
@
|
78
|
+
@include susy-media($query, $no-query) {
|
44
79
|
@content;
|
45
80
|
}
|
81
|
+
}
|
82
|
+
}
|
46
83
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
84
|
+
|
85
|
+
// Update Context
|
86
|
+
// -------------
|
87
|
+
// Set the new media context
|
88
|
+
@mixin susy-media-context(
|
89
|
+
$query,
|
90
|
+
$name: null,
|
91
|
+
$clean: false
|
92
|
+
) {
|
93
|
+
$query: map-merge((name: $name), $query);
|
94
|
+
|
95
|
+
@if $clean {
|
96
|
+
$_susy-media-context: $query !global;
|
97
|
+
} @else {
|
98
|
+
$_susy-media-context: map-merge($_susy-media-context, $query) !global;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
// Media Context
|
104
|
+
// -------------
|
105
|
+
// Return the full media context, or a single media property (e.g. min-width)
|
106
|
+
@function susy-media-context(
|
107
|
+
$property: false
|
108
|
+
) {
|
109
|
+
@if $property {
|
110
|
+
@return map-get($_susy-media-context, $property);
|
111
|
+
} @else {
|
112
|
+
@return $_susy-media-context;
|
56
113
|
}
|
57
114
|
}
|
58
115
|
|
59
116
|
|
60
117
|
// Get Media
|
61
118
|
// ---------
|
62
|
-
// Return a named media-query from $susy-
|
119
|
+
// Return a named media-query from $susy-media.
|
63
120
|
// - $name: <key>
|
64
121
|
@function susy-get-media(
|
65
122
|
$name
|
66
123
|
) {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
$query: susy-get-media($query);
|
71
|
-
}
|
72
|
-
|
73
|
-
@if not($query) {
|
74
|
-
@warn '"#{$name}" is not an option in $susy-breakpoints.';
|
124
|
+
@if map-has-key($susy-media, $name) {
|
125
|
+
$name: map-get($susy-media, $name);
|
126
|
+
$name: susy-get-media($name);
|
75
127
|
}
|
76
128
|
|
77
|
-
@return $
|
129
|
+
@return $name;
|
78
130
|
}
|
79
131
|
|
80
132
|
|
81
|
-
//
|
82
|
-
//
|
83
|
-
//
|
84
|
-
|
85
|
-
@function susy-parse-breakpoint(
|
133
|
+
// Render Media
|
134
|
+
// ------------
|
135
|
+
// Build a media-query string from various media settings
|
136
|
+
@function susy-render-media(
|
86
137
|
$query
|
87
138
|
) {
|
88
|
-
$output:
|
89
|
-
|
90
|
-
|
91
|
-
);
|
139
|
+
$output: null;
|
140
|
+
@each $property, $value in $query {
|
141
|
+
$string: null;
|
92
142
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
}
|
98
|
-
|
99
|
-
$i: 1;
|
100
|
-
@while $i <= length($query) {
|
101
|
-
$this: nth($query, $i);
|
102
|
-
|
103
|
-
@if type-of($this) == map {
|
104
|
-
$output: map-merge($output, $this);
|
105
|
-
} @else if type-of($this) == string {
|
106
|
-
$i: $i + 1;
|
107
|
-
@if $i > length($query) {
|
108
|
-
@warn 'No value supplied for #{$this}';
|
109
|
-
} @else {
|
110
|
-
$value: nth($query, $i);
|
111
|
-
$output: map-merge($output, ($this: $value));
|
112
|
-
}
|
113
|
-
} @else if type-of($this) == list {
|
114
|
-
$prop: nth($this, 1);
|
115
|
-
$value: nth($this, 2);
|
116
|
-
$output: map-merge($output, ($prop: $value));
|
117
|
-
} @else if type-of($this) == number {
|
118
|
-
$prop: null;
|
119
|
-
@each $key, $value in $output {
|
120
|
-
@if not($value) and not($prop) {
|
121
|
-
$prop: $key;
|
122
|
-
}
|
123
|
-
}
|
124
|
-
$output: map-merge($output, ($prop: $this));
|
143
|
+
@if $property == media {
|
144
|
+
$string: $value;
|
145
|
+
} @else {
|
146
|
+
$string: '(#{$property}: #{$value})';
|
125
147
|
}
|
126
148
|
|
127
|
-
$
|
149
|
+
$output: if($output, '#{$output} and #{$string}', $string);
|
128
150
|
}
|
129
151
|
|
130
152
|
@return $output;
|
131
153
|
}
|
132
154
|
|
133
155
|
|
134
|
-
//
|
135
|
-
//
|
136
|
-
|
137
|
-
@function susy-
|
156
|
+
// Parse Media
|
157
|
+
// -----------
|
158
|
+
// Return parsed media-query settings based on shorthand
|
159
|
+
@function susy-parse-media(
|
138
160
|
$query
|
139
161
|
) {
|
140
|
-
$
|
141
|
-
$
|
142
|
-
|
143
|
-
@
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
162
|
+
$mq: null;
|
163
|
+
@if type-of($query) == map {
|
164
|
+
$mq: $query;
|
165
|
+
} @else if type-of($query) == number {
|
166
|
+
$mq: (min-width: $query);
|
167
|
+
} @else if type-of($query) == list and length($query) == 2 {
|
168
|
+
@if type-of(nth($query, 1)) == number {
|
169
|
+
$mq: (
|
170
|
+
min-width: min($query...),
|
171
|
+
max-width: max($query...),
|
172
|
+
);
|
173
|
+
} @else {
|
174
|
+
$mq: (nth($query, 1): nth($query, 2));
|
150
175
|
}
|
176
|
+
} @else {
|
177
|
+
$mq: (media: '#{$query}');
|
151
178
|
}
|
152
179
|
|
153
|
-
@return $
|
180
|
+
@return $mq;
|
154
181
|
}
|
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.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Suzanne
|
@@ -136,9 +136,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
|
-
- - '
|
139
|
+
- - '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 1.
|
141
|
+
version: '1.2'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project: susy
|
144
144
|
rubygems_version: 2.1.10
|