breakpoint 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/breakpoint.rb +3 -2
- data/stylesheets/breakpoint/_parsers.scss +67 -46
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d745281dd5b7421bd0d4c5228eddd140622eef6
|
4
|
+
data.tar.gz: bf0461398ad3a4928c1c7f1d62e624dd24a745b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d1b24e6da7ba07482a58523ae29e5cb72bebc9d24f6c728db076b51597a59bfdeb4d13a2f4b41cc402e39a2a3b1ef95611a6df4a583db8b302f0819e8ea2d3
|
7
|
+
data.tar.gz: 644f56229e904491e9a037918395bf32dad0daf1dde6d50262f22310675536d133f985de249320b3768d7c7d8fbe46de4652dc5108a837b89fc04cb6d2adcb5f
|
data/lib/breakpoint.rb
CHANGED
@@ -7,77 +7,98 @@
|
|
7
7
|
@import "parsers/triple";
|
8
8
|
@import "parsers/resolution";
|
9
9
|
|
10
|
+
$Memo-Exists: function-exists(memo-get) and function-exists(memo-set);
|
11
|
+
|
10
12
|
//////////////////////////////
|
11
13
|
// Breakpoint Function
|
12
14
|
//////////////////////////////
|
13
15
|
@function breakpoint($query, $contexts...) {
|
14
|
-
|
15
|
-
$query-string: '';
|
16
|
-
$query-fallback: false;
|
16
|
+
$run: true;
|
17
17
|
$return: ();
|
18
18
|
|
19
|
-
//
|
20
|
-
$
|
21
|
-
|
19
|
+
// Grab the Memo Output if Memoization can be a thing
|
20
|
+
@if $Memo-Exists {
|
21
|
+
$return: memo-get(breakpoint, breakpoint $query $contexts);
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
@if $return != null {
|
24
|
+
$run: false;
|
25
|
+
}
|
26
|
+
}
|
26
27
|
|
28
|
+
@if not $Memo-Exists or $run {
|
29
|
+
// Internal Variables
|
30
|
+
$query-string: '';
|
31
|
+
$query-fallback: false;
|
32
|
+
$return: ();
|
27
33
|
|
28
|
-
|
29
|
-
|
34
|
+
// Reserve Global Private Breakpoint Context
|
35
|
+
$holder-context: $private-breakpoint-context-holder;
|
36
|
+
$holder-query-count: $private-breakpoint-query-count;
|
30
37
|
|
38
|
+
// Reset Global Private Breakpoint Context
|
39
|
+
$private-breakpoint-context-holder: () !global;
|
40
|
+
$private-breakpoint-query-count: 0 !global;
|
31
41
|
|
32
|
-
@if ($or-list == false and $breakpoint-legacy-syntax == false) {
|
33
|
-
$query-string: breakpoint-parse($query);
|
34
|
-
}
|
35
|
-
@else {
|
36
|
-
$length: length($query);
|
37
42
|
|
38
|
-
|
39
|
-
$
|
43
|
+
// Test to see if it's a comma-separated list
|
44
|
+
$or-list: if(list-separator($query) == 'comma', true, false);
|
45
|
+
|
40
46
|
|
41
|
-
@if ($
|
42
|
-
$
|
47
|
+
@if ($or-list == false and $breakpoint-legacy-syntax == false) {
|
48
|
+
$query-string: breakpoint-parse($query);
|
43
49
|
}
|
50
|
+
@else {
|
51
|
+
$length: length($query);
|
44
52
|
|
45
|
-
|
46
|
-
$
|
53
|
+
$last: nth($query, $length);
|
54
|
+
$query-fallback: breakpoint-no-query($last);
|
47
55
|
|
48
|
-
@
|
49
|
-
$
|
56
|
+
@if ($query-fallback != false) {
|
57
|
+
$length: $length - 1;
|
50
58
|
}
|
51
59
|
|
52
|
-
$
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
60
|
+
@if ($breakpoint-legacy-syntax == true) {
|
61
|
+
$mq: ();
|
62
|
+
|
63
|
+
@for $i from 1 through $length {
|
64
|
+
$mq: append($mq, nth($query, $i), comma);
|
65
|
+
}
|
66
|
+
|
67
|
+
$query-string: breakpoint-parse($mq);
|
68
|
+
}
|
69
|
+
@else {
|
70
|
+
$query-string: '';
|
71
|
+
@for $i from 1 through $length {
|
72
|
+
$query-string: $query-string + if($i == 1, '', ', ') + breakpoint-parse(nth($query, $i));
|
73
|
+
}
|
58
74
|
}
|
59
75
|
}
|
60
|
-
}
|
61
76
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
77
|
+
$return: ('query': $query-string,
|
78
|
+
'fallback': $query-fallback,
|
79
|
+
'context holder': $private-breakpoint-context-holder,
|
80
|
+
'query count': $private-breakpoint-query-count
|
81
|
+
);
|
82
|
+
@if length($contexts) > 0 and nth($contexts, 1) != false {
|
83
|
+
@if $query-fallback != false {
|
84
|
+
$context-setter: private-breakpoint-set-context('no-query', $query-fallback);
|
85
|
+
}
|
86
|
+
$context-map: ();
|
87
|
+
@each $context in $contexts {
|
88
|
+
$context-map: map-merge($context-map, ($context: breakpoint-get-context($context)));
|
89
|
+
}
|
90
|
+
$return: map-merge($return, (context: $context-map));
|
70
91
|
}
|
71
|
-
|
72
|
-
|
73
|
-
|
92
|
+
|
93
|
+
// Reset Global Private Breakpoint Context
|
94
|
+
$private-breakpoint-context-holder: () !global;
|
95
|
+
$private-breakpoint-query-count: 0 !global;
|
96
|
+
|
97
|
+
@if $Memo-Exists {
|
98
|
+
$holder: memo-set(breakpoint, breakpoint $query $contexts, $return);
|
74
99
|
}
|
75
|
-
$return: map-merge($return, (context: $context-map));
|
76
100
|
}
|
77
101
|
|
78
|
-
// Reset Global Private Breakpoint Context
|
79
|
-
$private-breakpoint-context-holder: () !global;
|
80
|
-
$private-breakpoint-query-count: 0 !global;
|
81
102
|
@return $return;
|
82
103
|
}
|
83
104
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breakpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mason Wendell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.0.0.alpha.13
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: sassy-maps
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - <
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.0.0
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - <
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.0.0
|
42
56
|
description: Really simple media queries in Sass
|
43
57
|
email:
|
44
58
|
- mason@thecodingdesigner.com
|