flint-gs 2.3.4 → 2.3.5
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/lib/flint/functions.rb +0 -28
- data/lib/flint/version.rb +1 -1
- data/stylesheets/flint/functions/_functions.scss +0 -1
- data/stylesheets/flint/functions/lib/_has-family-instance.scss +8 -4
- data/stylesheets/flint/functions/lib/_list-to-str.scss +15 -14
- data/stylesheets/flint/functions/lib/_map-fetch.scss +10 -10
- data/stylesheets/flint/functions/lib/_str-replace.scss +16 -16
- data/stylesheets/flint/functions/lib/_str-to-list.scss +60 -66
- data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +3 -2
- data/stylesheets/flint/functions/lib/_support-syntax.scss +5 -6
- data/stylesheets/flint/functions/lib/_types-in-list.scss +44 -85
- data/stylesheets/flint/mixins/lib/_main.scss +6 -6
- data/tests/config.rb +1 -1
- data/tests/input/functions/_functions.scss +0 -1
- data/tests/input/functions/lib/_has-family-instance.scss +1 -1
- data/tests/input/output.scss +1 -1
- data/tests/output/output.css +8 -8
- metadata +2 -5
- data/stylesheets/flint/functions/lib/_exists.scss +0 -36
- data/tests/input/functions/lib/_exists.scss +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81a28c36f676fbde6c568dfb62a3164ea6e77e40
|
4
|
+
data.tar.gz: f91de5d05feb984a162c94303f8dc1353b357dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761d263bc35f4861f527c2b48133e1f43488a3b802e3c18203a7bb20d0d9c4f3d328235ffc9bb9ae2fc9a41c3dba1c20f3fd35679866c5e6ab4070a0bc36bb4d
|
7
|
+
data.tar.gz: dfdfe90a7e47f9d008f4caef3dbd7b766994c071f5e8bad166fe26037cb2bbba4eec02c4e22bafcd7989ae4dc2826f40a1093d27e2de0e1fec999f2e0cf70477
|
data/lib/flint/functions.rb
CHANGED
@@ -96,32 +96,4 @@ module Flint
|
|
96
96
|
end
|
97
97
|
declare :flint_ruby_str_replace, :args => [:string, :find, :replace]
|
98
98
|
|
99
|
-
#
|
100
|
-
# Check if key exists in map
|
101
|
-
#
|
102
|
-
# @param {Map} map - map to search
|
103
|
-
# @param {String} key - key to search for
|
104
|
-
#
|
105
|
-
# @return {Bool}
|
106
|
-
#
|
107
|
-
def flint_ruby_exists(map, key)
|
108
|
-
assert_type map, :Map, :map
|
109
|
-
assert_type key, :String, :key
|
110
|
-
|
111
|
-
hash = map.to_h
|
112
|
-
|
113
|
-
if hash.fetch(key, false)
|
114
|
-
return Sass::Script::Bool.new(true)
|
115
|
-
else
|
116
|
-
hash.each do |_, value|
|
117
|
-
if value.is_a?(Sass::Script::Value::Map)
|
118
|
-
return Sass::Script::Bool.new(true) if flint_ruby_exists(value, key).value
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
Sass::Script::Bool.new(false)
|
124
|
-
end
|
125
|
-
declare :flint_ruby_exists, :args => [:map, :key]
|
126
|
-
|
127
99
|
end
|
data/lib/flint/version.rb
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
///
|
2
|
-
/// Checks if instance
|
2
|
+
/// Checks if instance exists in selector familiy tree, falls back from current selector
|
3
3
|
///
|
4
4
|
/// @access private
|
5
5
|
///
|
6
6
|
/// @param {String} $key - breakpoint key to search for matching instance
|
7
7
|
/// @param {String} $syntax - searches for instance using passed syntax parser
|
8
8
|
///
|
9
|
-
/// @return {String} instance selector
|
9
|
+
/// @return {String|False} instance selector
|
10
10
|
///
|
11
11
|
/// @group Internal Functions
|
12
12
|
///
|
13
13
|
@function flint-has-family-instance($key: flint-get-value("settings", "default"), $syntax: $flint-support-syntax) {
|
14
14
|
$selector: nth(&, 1);
|
15
15
|
|
16
|
+
@if not $key or not $selector {
|
17
|
+
@return false;
|
18
|
+
}
|
19
|
+
|
16
20
|
// Check if instance result had been cached
|
17
21
|
@if map-has-key($flint-cached-instances, "#{$selector}") {
|
18
22
|
// Get cached instance
|
@@ -31,7 +35,7 @@
|
|
31
35
|
@for $i from 1 through $length {
|
32
36
|
|
33
37
|
// Check last selector in list
|
34
|
-
@if
|
38
|
+
@if map-has-key($flint-instances, "#{flint-last($parsed-selector)}::#{$key}") {
|
35
39
|
|
36
40
|
// Cache result
|
37
41
|
$flint-cached-instances: map-merge($flint-cached-instances, ("#{$selector}": "#{flint-last($parsed-selector)}"));
|
@@ -59,7 +63,7 @@
|
|
59
63
|
$selector-string: flint-list-to-str($selector-list, " ");
|
60
64
|
|
61
65
|
// Make sure that we're not counting the current selector set
|
62
|
-
@if
|
66
|
+
@if map-has-key($flint-instances, "#{$selector-string}::#{$key}") and $selector != $selector-list {
|
63
67
|
|
64
68
|
// Cache result
|
65
69
|
$flint-cached-instances: map-merge($flint-cached-instances, ("#{$selector}": "#{$selector-string}"));
|
@@ -3,8 +3,6 @@
|
|
3
3
|
///
|
4
4
|
/// @access private
|
5
5
|
///
|
6
|
-
/// @link http://sassylists.com/documentation/#to-string
|
7
|
-
///
|
8
6
|
/// @param {List} $list
|
9
7
|
/// @param {String} $glue
|
10
8
|
/// @param {Bool} $is-nested
|
@@ -14,24 +12,27 @@
|
|
14
12
|
/// @group Internal Functions
|
15
13
|
///
|
16
14
|
@function flint-list-to-str($list, $glue: "", $is-nested: false) {
|
15
|
+
@if flint-is-string($list) {
|
16
|
+
$list: ($list,);
|
17
|
+
}
|
17
18
|
|
18
19
|
// Use Ruby function if available
|
19
20
|
@if $flint-use-ruby-functions {
|
20
21
|
@return flint_ruby_list_to_str($list, $glue);
|
21
|
-
}
|
22
|
-
$result: null;
|
23
|
-
$length: length($list);
|
22
|
+
}
|
24
23
|
|
25
|
-
|
26
|
-
|
24
|
+
$result: "";
|
25
|
+
$length: length($list);
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
} @else {
|
31
|
-
$result: if($i != length($list) or $is-nested, $result#{$n}#{$glue}, $result#{$n});
|
32
|
-
}
|
33
|
-
}
|
27
|
+
@for $i from 1 through $length {
|
28
|
+
$item: nth($list, $i);
|
34
29
|
|
35
|
-
@
|
30
|
+
@if flint-is-list($item) {
|
31
|
+
$result: $result + flint-list-to-str($item, $glue, true);
|
32
|
+
} @else {
|
33
|
+
$result: if($i != length($list) or $is-nested, $result + $item + $glue, $result + $item);
|
34
|
+
}
|
36
35
|
}
|
36
|
+
|
37
|
+
@return quote($result);
|
37
38
|
}
|
@@ -15,17 +15,17 @@
|
|
15
15
|
// Use Ruby function if available
|
16
16
|
@if $flint-use-ruby-functions {
|
17
17
|
@return flint_ruby_map_fetch($map, $keys...);
|
18
|
-
}
|
19
|
-
|
18
|
+
}
|
19
|
+
|
20
|
+
$result: $map;
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
22
|
+
@each $key in $keys {
|
23
|
+
@if $result {
|
24
|
+
$result: flint-is-map($result) and map-has-key($result, $key) and map-get($result, $key) or false;
|
25
|
+
} @else {
|
26
|
+
@return false;
|
27
27
|
}
|
28
|
-
|
29
|
-
@return $result;
|
30
28
|
}
|
29
|
+
|
30
|
+
@return $result;
|
31
31
|
}
|
@@ -16,24 +16,24 @@
|
|
16
16
|
// Use Ruby function if available
|
17
17
|
@if $flint-use-ruby-functions {
|
18
18
|
@return flint_ruby_str_replace($string, $substring, $new-substring);
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
// If count is index of substring
|
27
|
-
@if $i == $sub-index {
|
28
|
-
// Slice string to exclude substring
|
29
|
-
$string-before: str-slice($string, 1, $i - 1);
|
30
|
-
$string-after: str-slice($string, $i + $sub-length, str-length($string));
|
31
|
-
// Create new string
|
32
|
-
$string: $string-before + $new-substring + $string-after;
|
33
|
-
}
|
19
|
+
}
|
20
|
+
|
21
|
+
// Loop through length of string
|
22
|
+
@for $i from 1 through str-length($string) {
|
23
|
+
// Get index and length of substring
|
24
|
+
$sub-index: str-index($string, $substring);
|
25
|
+
$sub-length: str-length($substring);
|
34
26
|
|
27
|
+
// If count is index of substring
|
28
|
+
@if $i == $sub-index {
|
29
|
+
// Slice string to exclude substring
|
30
|
+
$string-before: str-slice($string, 1, $i - 1);
|
31
|
+
$string-after: str-slice($string, $i + $sub-length, str-length($string));
|
32
|
+
// Create new string
|
33
|
+
$string: $string-before + $new-substring + $string-after;
|
35
34
|
}
|
36
35
|
|
37
|
-
@return $string;
|
38
36
|
}
|
37
|
+
|
38
|
+
@return $string;
|
39
39
|
}
|
@@ -12,84 +12,78 @@
|
|
12
12
|
/// @group Internal Functions
|
13
13
|
///
|
14
14
|
@function flint-str-to-list($string, $find: " ", $ignore: ",") {
|
15
|
-
@if flint-is-string($string) {
|
16
|
-
|
17
|
-
|
18
|
-
@if $flint-use-ruby-functions {
|
19
|
-
@return flint_ruby_str_to_list($string, $find, $ignore);
|
20
|
-
} @else {
|
21
|
-
$string-list: ();
|
22
|
-
$space-indexes: ();
|
23
|
-
$ignore-remainder: ();
|
24
|
-
$length: str-length($string);
|
25
|
-
|
26
|
-
// Find ignore separator, and flint-remove remainder of string beyond that point
|
27
|
-
@for $i from 1 through $length {
|
28
|
-
$slice: str-slice($string, $i, $i);
|
29
|
-
@if $slice == $ignore {
|
30
|
-
$ignore-remainder: append($ignore-remainder, $i - 1, "comma");
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
// Redefine string and length
|
35
|
-
@if length($ignore-remainder) >= 1 {
|
36
|
-
$string: str-slice($string, 1, nth($ignore-remainder, 1));
|
37
|
-
$length: str-length($string);
|
38
|
-
}
|
39
|
-
|
40
|
-
// Find all spaces and their indices by looking over each character in string
|
41
|
-
@for $i from 1 through $length {
|
42
|
-
$slice: str-slice($string, $i, $i);
|
43
|
-
@if $slice == $find {
|
44
|
-
$space-indexes: append($space-indexes, $i, "comma");
|
45
|
-
}
|
46
|
-
}
|
15
|
+
@if not flint-is-string($string) {
|
16
|
+
@return false;
|
17
|
+
}
|
47
18
|
|
48
|
-
|
49
|
-
|
19
|
+
// Use Ruby function if available
|
20
|
+
@if $flint-use-ruby-functions {
|
21
|
+
@return flint_ruby_str_to_list($string, $find, $ignore);
|
22
|
+
}
|
50
23
|
|
51
|
-
|
52
|
-
|
24
|
+
$string-list: ();
|
25
|
+
$space-indexes: ();
|
26
|
+
$ignore-remainder: ();
|
27
|
+
$length: str-length($string);
|
53
28
|
|
54
|
-
|
55
|
-
|
29
|
+
// Find ignore separator, and flint-remove remainder of string beyond that point
|
30
|
+
@for $i from 1 through $length {
|
31
|
+
$slice: str-slice($string, $i, $i);
|
32
|
+
@if $slice == $ignore {
|
33
|
+
$ignore-remainder: append($ignore-remainder, $i - 1, "comma");
|
34
|
+
}
|
35
|
+
}
|
56
36
|
|
57
|
-
|
58
|
-
|
59
|
-
|
37
|
+
// Redefine string and length
|
38
|
+
@if length($ignore-remainder) >= 1 {
|
39
|
+
$string: str-slice($string, 1, nth($ignore-remainder, 1));
|
40
|
+
$length: str-length($string);
|
41
|
+
}
|
60
42
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
43
|
+
// Find all spaces and their indices by looking over each character in string
|
44
|
+
@for $i from 1 through $length {
|
45
|
+
$slice: str-slice($string, $i, $i);
|
46
|
+
@if $slice == $find {
|
47
|
+
$space-indexes: append($space-indexes, $i, "comma");
|
48
|
+
}
|
49
|
+
}
|
67
50
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
51
|
+
// Check if there are any spaces
|
52
|
+
@if length($space-indexes) < 1 {
|
53
|
+
@return flint-purge(append($string-list, $string));
|
54
|
+
}
|
72
55
|
|
73
|
-
|
74
|
-
|
75
|
-
}
|
56
|
+
// Keep a count of number of spaces
|
57
|
+
$count: 1;
|
76
58
|
|
77
|
-
|
78
|
-
|
79
|
-
$matched-string: str-slice($string, ($flint-last-space + 1), $length);
|
80
|
-
$string-list: append($string-list, $matched-string, "comma");
|
59
|
+
// Loop through each space
|
60
|
+
@each $space in $space-indexes {
|
81
61
|
|
82
|
-
|
83
|
-
|
84
|
-
|
62
|
+
// If is initial count, grab first substring and store in list
|
63
|
+
@if $count == 1 {
|
64
|
+
$matched-string: str-slice($string, 0, ($space - 1));
|
85
65
|
|
86
|
-
|
87
|
-
|
66
|
+
@if $matched-string != "" {
|
67
|
+
$string-list: append($string-list, $matched-string, "comma");
|
68
|
+
}
|
69
|
+
// Else, add a little math to make up for the spaces to do the same
|
70
|
+
} @else {
|
71
|
+
$matched-string: str-slice($string, (nth($space-indexes, ($count - 1)) + 1), ($space - 1));
|
88
72
|
|
89
|
-
|
73
|
+
@if $matched-string != "" {
|
74
|
+
$string-list: append($string-list, $matched-string, "comma");
|
90
75
|
}
|
91
76
|
}
|
92
|
-
|
93
|
-
|
77
|
+
|
78
|
+
// Increase count
|
79
|
+
$count: $count + 1;
|
94
80
|
}
|
81
|
+
|
82
|
+
// Now grab that last selector
|
83
|
+
$flint-last-space: nth($space-indexes, length($space-indexes));
|
84
|
+
$matched-string: str-slice($string, ($flint-last-space + 1), $length);
|
85
|
+
$string-list: append($string-list, $matched-string, "comma");
|
86
|
+
|
87
|
+
// Finally, return comma separated list of selectors
|
88
|
+
@return flint-purge($string-list);
|
95
89
|
}
|
@@ -10,15 +10,16 @@
|
|
10
10
|
/// @group Internal Functions
|
11
11
|
///
|
12
12
|
@function flint-support-syntax-bem($selectors) {
|
13
|
+
$selectors: flint-list-to-str($selectors, " ");
|
13
14
|
// Clean up selector, remove double underscores for spaces
|
14
15
|
// add pseudo character to differentiate selectors
|
15
|
-
$selectors: flint-str-replace(
|
16
|
+
$selectors: flint-str-replace($selectors, "__", "/");
|
16
17
|
// Parse string back to list without pseudo character
|
17
18
|
$selectors: flint-str-to-list($selectors, "/");
|
18
19
|
// Define top-most parent of selector
|
19
20
|
$parent: nth($selectors, 1);
|
20
21
|
// Create new list of parsed selectors
|
21
|
-
$selector-list: (
|
22
|
+
$selector-list: ($parent,);
|
22
23
|
|
23
24
|
// Loop over each selector and build list of selectors
|
24
25
|
@each $selector in $selectors {
|
@@ -20,13 +20,12 @@
|
|
20
20
|
//
|
21
21
|
// WARNING: Be sure you have created a custom function to support an unknown syntax
|
22
22
|
@return call("flint-support-syntax-#{$syntax}", $selectors);
|
23
|
+
}
|
23
24
|
|
25
|
+
@if not $flint-development-mode {
|
26
|
+
// Throw error if the syntax does not exist and a function to call cannot be found
|
27
|
+
@error "You did not pass a valid syntax to `flint-support-syntax`: #{$syntax}. Either specify a custom `flint-support-syntax-<syntax>` function to call, or use one of the offically supported syntaxes. For more info, please visit the docs.";
|
24
28
|
} @else {
|
25
|
-
@
|
26
|
-
// Throw error if the syntax does not exist and a function to call cannot be found
|
27
|
-
@error "You did not pass a valid syntax to `flint-support-syntax`: #{$syntax}. Either specify a custom `flint-support-syntax-<syntax>` function to call, or use one of the offically supported syntaxes. For more info, please visit the docs.";
|
28
|
-
} @else {
|
29
|
-
@return false;
|
30
|
-
}
|
29
|
+
@return false;
|
31
30
|
}
|
32
31
|
}
|
@@ -12,106 +12,65 @@
|
|
12
12
|
/// @group Internal Functions
|
13
13
|
///
|
14
14
|
@function flint-types-in-list($list, $assert-types: null, $assert-length: null) {
|
15
|
-
@if flint-is-list($list) {
|
16
|
-
|
17
|
-
|
18
|
-
@if $assert-types {
|
19
|
-
|
20
|
-
// Assert length of list?
|
21
|
-
@if $assert-length {
|
22
|
-
// Get length of list
|
23
|
-
$length: length($list);
|
24
|
-
|
25
|
-
// Make sure lengths match
|
26
|
-
@if $length == $assert-length {
|
27
|
-
// Keep empty list of types
|
28
|
-
$types: ();
|
29
|
-
|
30
|
-
// List of asserted types?
|
31
|
-
@if flint-is-list($assert-types) {
|
32
|
-
|
33
|
-
// Make sure length of types match list
|
34
|
-
@if length($assert-types) == $length {
|
35
|
-
|
36
|
-
// Loop over each item in list
|
37
|
-
@for $i from 1 through $assert-length {
|
38
|
-
$item: nth($list, $i);
|
39
|
-
$type: nth($assert-types, $i);
|
40
|
-
|
41
|
-
// Check if type of item matches asserted type
|
42
|
-
@if type-of($item) != $type {
|
43
|
-
@return false;
|
44
|
-
}
|
15
|
+
@if not flint-is-list($list) {
|
16
|
+
@return false;
|
17
|
+
}
|
45
18
|
|
46
|
-
|
47
|
-
|
19
|
+
@if not $assert-types {
|
20
|
+
$type: type-of(nth($list, 1));
|
48
21
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
22
|
+
@each $item in $list {
|
23
|
+
@if type-of($item) != $type {
|
24
|
+
@return false;
|
25
|
+
}
|
26
|
+
}
|
53
27
|
|
54
|
-
|
55
|
-
|
56
|
-
// Assert single type
|
57
|
-
$type: nth($assert-types, 1);
|
28
|
+
@return true;
|
29
|
+
}
|
58
30
|
|
59
|
-
|
60
|
-
|
61
|
-
$item: nth($list, $i);
|
31
|
+
@if not $assert-length {
|
32
|
+
$type: $assert-types;
|
62
33
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
34
|
+
@each $item in $list {
|
35
|
+
@if type-of($item) != $type {
|
36
|
+
@return false;
|
37
|
+
}
|
38
|
+
}
|
68
39
|
|
69
|
-
|
70
|
-
|
40
|
+
@return true;
|
41
|
+
}
|
71
42
|
|
72
|
-
|
73
|
-
@return true;
|
43
|
+
$length: length($list);
|
74
44
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}
|
45
|
+
@if $length != $assert-length {
|
46
|
+
@return false;
|
47
|
+
}
|
79
48
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
49
|
+
@if flint-is-list($assert-types) {
|
50
|
+
@if length($assert-types) != $length {
|
51
|
+
@return false;
|
52
|
+
}
|
84
53
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
@if type-of($item) != $type {
|
89
|
-
@return false;
|
90
|
-
}
|
91
|
-
}
|
54
|
+
@for $i from 1 through $assert-length {
|
55
|
+
$item: nth($list, $i);
|
56
|
+
$type: nth($assert-types, $i);
|
92
57
|
|
93
|
-
|
94
|
-
@return
|
58
|
+
@if type-of($item) != $type {
|
59
|
+
@return false;
|
95
60
|
}
|
61
|
+
}
|
96
62
|
|
97
|
-
|
98
|
-
|
99
|
-
// Get type of first item in list
|
100
|
-
$type: type-of(nth($list, 1));
|
63
|
+
} @else {
|
64
|
+
$type: nth($assert-types, 1);
|
101
65
|
|
102
|
-
|
103
|
-
|
104
|
-
// Check if type of item matches asserted type
|
105
|
-
@if type-of($item) != $type {
|
106
|
-
@return false;
|
107
|
-
}
|
108
|
-
}
|
66
|
+
@for $i from 1 through $assert-length {
|
67
|
+
$item: nth($list, $i);
|
109
68
|
|
110
|
-
@
|
69
|
+
@if type-of($item) != $type {
|
70
|
+
@return false;
|
71
|
+
}
|
111
72
|
}
|
112
|
-
|
113
|
-
// Was not a list, return false
|
114
|
-
} @else {
|
115
|
-
@return false;
|
116
73
|
}
|
74
|
+
|
75
|
+
@return true;
|
117
76
|
}
|
@@ -456,7 +456,7 @@
|
|
456
456
|
// Check if key exists as breakpoint, and if so wrap
|
457
457
|
// in query to not affect other breakpoints
|
458
458
|
//
|
459
|
-
@if
|
459
|
+
@if map-has-key(map-get($flint, "breakpoints"), $key) {
|
460
460
|
|
461
461
|
@if flint-get-value("settings", "grid") == "fluid" {
|
462
462
|
@if flint-is-highest-breakpoint($key) {
|
@@ -568,7 +568,7 @@
|
|
568
568
|
}
|
569
569
|
|
570
570
|
// Output container for specific breakpoint if exists
|
571
|
-
} @else if
|
571
|
+
} @else if map-has-key(map-get($flint, "breakpoints"), $key) and flint-get-value("settings", "grid") == "fixed" {
|
572
572
|
|
573
573
|
@if flint-is-highest-breakpoint($key) {
|
574
574
|
|
@@ -587,7 +587,7 @@
|
|
587
587
|
}
|
588
588
|
|
589
589
|
}
|
590
|
-
} @else if
|
590
|
+
} @else if map-has-key(map-get($flint, "breakpoints"), $key) and flint-get-value("settings", "grid") == "fluid" {
|
591
591
|
@if flint-is-highest-breakpoint($key) {
|
592
592
|
|
593
593
|
@media ( min-width: (flint-calc-breakpoint("next", $key, flint-get-index($key)) + $unit) ) {
|
@@ -742,7 +742,7 @@
|
|
742
742
|
or flint-is-string($key) and flint-is-number($span) and $context == "auto" {
|
743
743
|
|
744
744
|
// Throw error for invalid argument lengths
|
745
|
-
@if not
|
745
|
+
@if not map-has-key(map-get($flint, "breakpoints"), $key) {
|
746
746
|
@if not $flint-development-mode {
|
747
747
|
@error "Invalid argument: #{$key}. Breakpoint does not exist. Please provide a valid argument.";
|
748
748
|
}
|
@@ -812,7 +812,7 @@
|
|
812
812
|
//
|
813
813
|
// Wrap content in media query
|
814
814
|
//
|
815
|
-
} @else if
|
815
|
+
} @else if map-has-key(map-get($flint, "breakpoints"), $key) and $span == null and $context == null
|
816
816
|
or flint-is-list($key) and $span == null and $context == null {
|
817
817
|
|
818
818
|
//
|
@@ -1011,7 +1011,7 @@
|
|
1011
1011
|
@for $i from 1 through length($key) {
|
1012
1012
|
$calc-key: nth($key, $i);
|
1013
1013
|
|
1014
|
-
@if
|
1014
|
+
@if map-has-key(map-get($flint, "breakpoints"), $calc-key) {
|
1015
1015
|
@if flint-get-value("settings", "grid") == "fluid" {
|
1016
1016
|
@if flint-is-highest-breakpoint($calc-key) {
|
1017
1017
|
$query: append($query, unquote('( min-width: #{(flint-calc-breakpoint("next", $calc-key, flint-get-index($calc-key)) + $unit)} )'), "comma");
|
data/tests/config.rb
CHANGED
data/tests/input/output.scss
CHANGED
data/tests/output/output.css
CHANGED
@@ -30,7 +30,7 @@ html:after {
|
|
30
30
|
@media (min-width: 60.0625em) {
|
31
31
|
html:after {
|
32
32
|
max-width: 80em;
|
33
|
-
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270
|
33
|
+
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270%%27%20x2%3D%27100%%27%20y2%3D%270%%27%3E%3Cstop%20offset%3D%270%%27%20style%3D%27stop%2Dcolor%3A%20%23f33%3B%27%20%2F%3E%3Cstop%20offset%3D%27100%%27%20style%3D%27stop%2Dcolor%3A%20%23ff6666%3B%27%20%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%270%2E78125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%277%2E03125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2713%2E28125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2719%2E53125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2725%2E78125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2732%2E03125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2738%2E28125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2744%2E53125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2750%2E78125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2757%2E03125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2763%2E28125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2769%2E53125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%274%2E6875%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2775%2E78125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D'4%2E6875%'%20height%3D'100%'%2F%3E%3Crect%20x%3D'82%2E03125%'%20fill%3D'url%28%23gr%29'%20width%3D'4%2E6875%'%20height%3D'100%'%2F%3E%3Crect x%3D'88%2E28125%' fill='url%28%23gr%29' width='4%2E6875%' height='100%'%2F%3E%3Crect x='94.53125%' fill='url%28%23gr%29' width='4.6875%' height='100%'/></svg>");
|
34
34
|
background-size: 100% 100%;
|
35
35
|
background-position: 0 0;
|
36
36
|
}
|
@@ -38,7 +38,7 @@ html:after {
|
|
38
38
|
@media (min-width: 40.0625em) and (max-width: 60em) {
|
39
39
|
html:after {
|
40
40
|
max-width: 60em;
|
41
|
-
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270
|
41
|
+
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270%%27%20x2%3D%27100%%27%20y2%3D%270%%27%3E%3Cstop%20offset%3D%270%%27%20style%3D%27stop%2Dcolor%3A%20%23f33%3B%27%20%2F%3E%3Cstop%20offset%3D%27100%%27%20style%3D%27stop%2Dcolor%3A%20%23ff6666%3B%27%20%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%271%2E04167%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%279%2E375%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2717%2E70833%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2726%2E04167%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2734%2E375%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2742%2E70833%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2751%2E04167%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2759%2E375%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2767%2E70833%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%276%2E25%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2776%2E04167%%27%20fill%3D'url%28%23gr%29'%20width%3D'6%2E25%'%20height%3D'100%'%2F%3E%3Crect%20x%3D'84%2E375%'%20fill%3D'url%28%23gr%29' width%3D'6%2E25%' height='100%'%2F%3E%3Crect x='92%2E70833%' fill='url%28%23gr%29' width='6.25%' height='100%'/></svg>");
|
42
42
|
background-size: 100% 100%;
|
43
43
|
background-position: 0 0;
|
44
44
|
}
|
@@ -46,7 +46,7 @@ html:after {
|
|
46
46
|
@media (min-width: 20.0625em) and (max-width: 40em) {
|
47
47
|
html:after {
|
48
48
|
max-width: 40em;
|
49
|
-
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270
|
49
|
+
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270%%27%20x2%3D%27100%%27%20y2%3D%270%%27%3E%3Cstop%20offset%3D%270%%27%20style%3D%27stop%2Dcolor%3A%20%23f33%3B%27%20%2F%3E%3Cstop%20offset%3D%27100%%27%20style%3D%27stop%2Dcolor%3A%20%23ff6666%3B%27%20%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%271%2E5625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2714%2E0625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2726%2E5625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2739%2E0625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2751%2E5625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2764%2E0625%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%279%2E375%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D'76%2E5625%'%20fill%3D'url%28%23gr%29'%20width%3D'9%2E375%'%20height%3D'100%'%2F%3E%3Crect x='89%2E0625%' fill='url%28%23gr%29' width='9.375%' height='100%'/></svg>");
|
50
50
|
background-size: 100% 100%;
|
51
51
|
background-position: 0 0;
|
52
52
|
}
|
@@ -54,7 +54,7 @@ html:after {
|
|
54
54
|
@media (min-width: 0) and (max-width: 20em) {
|
55
55
|
html:after {
|
56
56
|
max-width: 20em;
|
57
|
-
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270
|
57
|
+
background-image: url("data:image/svg+xml,%3Csvg%20version%3D%271%2E1%27%20xmlns%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxlink%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27gr%27%20x1%3D%270%25%27%20y1%3D%270%%27%20x2%3D%27100%%27%20y2%3D%270%%27%3E%3Cstop%20offset%3D%270%%27%20style%3D%27stop%2Dcolor%3A%20%23f33%3B%27%20%2F%3E%3Cstop%20offset%3D%27100%%27%20style%3D%27stop%2Dcolor%3A%20%23ff6666%3B%27%20%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%273%2E125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%2718%2E75%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2728%2E125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%2718%2E75%%27%20height%3D%27100%%27%2F%3E%3Crect%20x%3D%2753%2E125%%27%20fill%3D%27url%28%23gr%29%27%20width%3D%2718%2E75%%27%20height%3D'100%'%2F%3E%3Crect%20x%3D'78%2E125%' fill%3D'url%28%23gr%29' width='18%2E75%' height='100%'/></svg>");
|
58
58
|
background-size: 100% 100%;
|
59
59
|
background-position: 0 0;
|
60
60
|
}
|
@@ -296,10 +296,10 @@ html:after {
|
|
296
296
|
|
297
297
|
Test Results {
|
298
298
|
Success: true;
|
299
|
-
Stats: ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔
|
300
|
-
Tests:
|
301
|
-
Asserts:
|
302
|
-
Passed:
|
299
|
+
Stats: ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔;
|
300
|
+
Tests: 76;
|
301
|
+
Asserts: 177;
|
302
|
+
Passed: 76;
|
303
303
|
Failed: 0;
|
304
304
|
Skipped: 0;
|
305
305
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flint-gs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,7 +85,6 @@ files:
|
|
85
85
|
- stylesheets/flint/functions/helpers/_helpers.scss
|
86
86
|
- stylesheets/flint/functions/lib/_calc-breakpoint.scss
|
87
87
|
- stylesheets/flint/functions/lib/_calc-width.scss
|
88
|
-
- stylesheets/flint/functions/lib/_exists.scss
|
89
88
|
- stylesheets/flint/functions/lib/_fluid-width.scss
|
90
89
|
- stylesheets/flint/functions/lib/_get-index.scss
|
91
90
|
- stylesheets/flint/functions/lib/_get-instance-value.scss
|
@@ -201,7 +200,6 @@ files:
|
|
201
200
|
- tests/input/functions/helpers/_helpers.scss
|
202
201
|
- tests/input/functions/lib/_calc-breakpoint.scss
|
203
202
|
- tests/input/functions/lib/_calc-width.scss
|
204
|
-
- tests/input/functions/lib/_exists.scss
|
205
203
|
- tests/input/functions/lib/_fluid-width.scss
|
206
204
|
- tests/input/functions/lib/_get-index.scss
|
207
205
|
- tests/input/functions/lib/_get-instance-value.scss
|
@@ -335,7 +333,6 @@ test_files:
|
|
335
333
|
- tests/input/functions/helpers/_helpers.scss
|
336
334
|
- tests/input/functions/lib/_calc-breakpoint.scss
|
337
335
|
- tests/input/functions/lib/_calc-width.scss
|
338
|
-
- tests/input/functions/lib/_exists.scss
|
339
336
|
- tests/input/functions/lib/_fluid-width.scss
|
340
337
|
- tests/input/functions/lib/_get-index.scss
|
341
338
|
- tests/input/functions/lib/_get-instance-value.scss
|
@@ -1,36 +0,0 @@
|
|
1
|
-
///
|
2
|
-
/// Check if key exists in map
|
3
|
-
///
|
4
|
-
/// @access private
|
5
|
-
///
|
6
|
-
/// @param {Map} $map - map to search
|
7
|
-
/// @param {String} $key - key to search for
|
8
|
-
///
|
9
|
-
/// @return {Bool}
|
10
|
-
///
|
11
|
-
/// @group Internal Functions
|
12
|
-
///
|
13
|
-
@function flint-exists($map, $key) {
|
14
|
-
|
15
|
-
@if not flint-is-string($key) {
|
16
|
-
@return false;
|
17
|
-
}
|
18
|
-
|
19
|
-
// Use Ruby function if available
|
20
|
-
@if $flint-use-ruby-functions {
|
21
|
-
@return flint_ruby_exists($map, $key);
|
22
|
-
} @else {
|
23
|
-
$is-map: flint-is-map($map);
|
24
|
-
$top-has-key: $is-map and map-has-key($map, $key) or false;
|
25
|
-
|
26
|
-
@if $top-has-key {
|
27
|
-
@return true;
|
28
|
-
} @else if $is-map {
|
29
|
-
@each $m, $k in $map {
|
30
|
-
@return flint-exists($k, $key)
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
@return false;
|
35
|
-
}
|
36
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// Check if key exists in map
|
3
|
-
//
|
4
|
-
@include describe("[function] exists") {
|
5
|
-
|
6
|
-
$map: (
|
7
|
-
"key": "value",
|
8
|
-
"map": (
|
9
|
-
"deep key": "value"
|
10
|
-
)
|
11
|
-
);
|
12
|
-
|
13
|
-
@include it("should expect key to exist within map") {
|
14
|
-
@include should(expect(
|
15
|
-
flint-exists($map, "key")),
|
16
|
-
to(be(true))
|
17
|
-
);
|
18
|
-
@include should(expect(
|
19
|
-
flint-exists($map, "deep key")),
|
20
|
-
to(be(true))
|
21
|
-
);
|
22
|
-
}
|
23
|
-
|
24
|
-
@include it("should expect key to not exist within map") {
|
25
|
-
@include should(expect(
|
26
|
-
flint-exists($map, "unknown")),
|
27
|
-
to(be(false))
|
28
|
-
);
|
29
|
-
}
|
30
|
-
}
|