respond-to 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/stylesheets/_respond-to.scss +17 -21
- metadata +2 -2
@@ -6,35 +6,31 @@
|
|
6
6
|
////////////////////////
|
7
7
|
// Default the Breakpoints variable
|
8
8
|
////////////////////////
|
9
|
-
$breakpoints:
|
9
|
+
$breakpoints: () !default;
|
10
10
|
|
11
11
|
////////////////////////
|
12
12
|
// Respond-to API Mixin
|
13
13
|
////////////////////////
|
14
14
|
@mixin respond-to($context, $media: $breakpoint-default-media) {
|
15
|
-
@
|
16
|
-
@
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
@
|
23
|
-
|
24
|
-
@if $i == 2 {
|
25
|
-
$mq: nth($bkpt, $i);
|
26
|
-
}
|
27
|
-
// Else, join $mq
|
28
|
-
@else {
|
29
|
-
$mq: join($mq, nth($bkpt, $i));
|
30
|
-
}
|
15
|
+
@each $bkpt in $breakpoints {
|
16
|
+
@if $context == nth($bkpt, 1) {
|
17
|
+
$length: length($bkpt);
|
18
|
+
$mq: false !default;
|
19
|
+
|
20
|
+
@for $i from 2 through $length {
|
21
|
+
// If it's the first item, override $mq
|
22
|
+
@if $i == 2 {
|
23
|
+
$mq: nth($bkpt, $i);
|
31
24
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
@content;
|
25
|
+
// Else, join $mq
|
26
|
+
@else {
|
27
|
+
$mq: join($mq, nth($bkpt, $i));
|
36
28
|
}
|
37
29
|
}
|
30
|
+
|
31
|
+
@include breakpoint($mq, $media) {
|
32
|
+
@content;
|
33
|
+
}
|
38
34
|
}
|
39
35
|
}
|
40
36
|
}
|