flint-gs 2.3.6 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.md +99 -98
  4. data/lib/flint-gs.rb +8 -0
  5. data/lib/flint.rb +22 -16
  6. data/lib/flint/functions.rb +99 -99
  7. data/lib/flint/version.rb +3 -3
  8. data/stylesheets/_flint.scss +7 -7
  9. data/stylesheets/flint/config/_config.scss +56 -56
  10. data/stylesheets/flint/functions/_functions.scss +48 -48
  11. data/stylesheets/flint/functions/helpers/_helpers.scss +229 -229
  12. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +47 -47
  13. data/stylesheets/flint/functions/lib/_calc-width.scss +70 -70
  14. data/stylesheets/flint/functions/lib/_fluid-width.scss +15 -15
  15. data/stylesheets/flint/functions/lib/_get-index.scss +21 -21
  16. data/stylesheets/flint/functions/lib/_get-instance-value.scss +15 -15
  17. data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
  18. data/stylesheets/flint/functions/lib/_has-family-instance.scss +84 -84
  19. data/stylesheets/flint/functions/lib/_html-encode.scss +14 -14
  20. data/stylesheets/flint/functions/lib/_instance.scss +48 -48
  21. data/stylesheets/flint/functions/lib/_last.scss +14 -14
  22. data/stylesheets/flint/functions/lib/_list-to-str.scss +38 -38
  23. data/stylesheets/flint/functions/lib/_map-fetch.scss +31 -31
  24. data/stylesheets/flint/functions/lib/_next-index.scss +14 -14
  25. data/stylesheets/flint/functions/lib/_purge.scss +24 -24
  26. data/stylesheets/flint/functions/lib/_remove.scss +18 -18
  27. data/stylesheets/flint/functions/lib/_replace.scss +30 -30
  28. data/stylesheets/flint/functions/lib/_steal-key.scss +32 -32
  29. data/stylesheets/flint/functions/lib/_steal-values.scss +15 -15
  30. data/stylesheets/flint/functions/lib/_str-replace.scss +39 -39
  31. data/stylesheets/flint/functions/lib/_str-to-list.scss +89 -89
  32. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +37 -37
  33. data/stylesheets/flint/functions/lib/_support-syntax.scss +31 -31
  34. data/stylesheets/flint/functions/lib/_types-in-list.scss +76 -76
  35. data/stylesheets/flint/functions/lib/_use-syntax.scss +22 -22
  36. data/stylesheets/flint/globals/_globals.scss +122 -122
  37. data/stylesheets/flint/mixins/_mixins.scss +11 -11
  38. data/stylesheets/flint/mixins/lib/_box-sizing.scss +18 -18
  39. data/stylesheets/flint/mixins/lib/_calculate.scss +241 -241
  40. data/stylesheets/flint/mixins/lib/_clearfix.scss +29 -29
  41. data/stylesheets/flint/mixins/lib/_container.scss +45 -45
  42. data/stylesheets/flint/mixins/lib/_grid-overlay.scss +73 -73
  43. data/stylesheets/flint/mixins/lib/_main.scss +1057 -1057
  44. data/stylesheets/flint/mixins/lib/_new-instance.scss +28 -28
  45. data/stylesheets/flint/mixins/lib/_print-instance.scss +44 -44
  46. data/tests/config.rb +22 -34
  47. data/tests/input/functions/_functions.scss +47 -47
  48. data/tests/input/functions/helpers/_helpers.scss +437 -437
  49. data/tests/input/functions/lib/_calc-breakpoint.scss +62 -62
  50. data/tests/input/functions/lib/_calc-width.scss +195 -195
  51. data/tests/input/functions/lib/_fluid-width.scss +32 -32
  52. data/tests/input/functions/lib/_get-index.scss +31 -31
  53. data/tests/input/functions/lib/_get-instance-value.scss +72 -72
  54. data/tests/input/functions/lib/_get-value.scss +28 -28
  55. data/tests/input/functions/lib/_has-family-instance.scss +35 -35
  56. data/tests/input/functions/lib/_instance.scss +187 -187
  57. data/tests/input/functions/lib/_last.scss +18 -18
  58. data/tests/input/functions/lib/_list-to-str.scss +28 -28
  59. data/tests/input/functions/lib/_map-fetch.scss +34 -34
  60. data/tests/input/functions/lib/_next-index.scss +24 -24
  61. data/tests/input/functions/lib/_purge.scss +14 -14
  62. data/tests/input/functions/lib/_remove.scss +14 -14
  63. data/tests/input/functions/lib/_replace.scss +14 -14
  64. data/tests/input/functions/lib/_steal-key.scss +19 -19
  65. data/tests/input/functions/lib/_steal-values.scss +16 -16
  66. data/tests/input/functions/lib/_str-replace.scss +14 -14
  67. data/tests/input/functions/lib/_str-to-list.scss +28 -28
  68. data/tests/input/functions/lib/_support-syntax-bem.scss +14 -14
  69. data/tests/input/functions/lib/_support-syntax.scss +21 -21
  70. data/tests/input/functions/lib/_types-in-list.scss +50 -50
  71. data/tests/input/functions/lib/_use-syntax.scss +14 -14
  72. data/tests/input/output.scss +250 -250
  73. data/tests/output/output.css +3499 -3499
  74. data/tests/tests.html +110 -110
  75. metadata +12 -212
  76. data/tests/bootcamp/CHANGELOG.md +0 -70
  77. data/tests/bootcamp/CONTRIBUTING.md +0 -72
  78. data/tests/bootcamp/Gruntfile.coffee +0 -34
  79. data/tests/bootcamp/LICENSE.md +0 -7
  80. data/tests/bootcamp/README.md +0 -52
  81. data/tests/bootcamp/bower.json +0 -15
  82. data/tests/bootcamp/dist/_bootcamp.scss +0 -46
  83. data/tests/bootcamp/dist/bootcamp.coffee +0 -101
  84. data/tests/bootcamp/dist/core/functions/_actual.scss +0 -3
  85. data/tests/bootcamp/dist/core/functions/_error.scss +0 -29
  86. data/tests/bootcamp/dist/core/functions/_expect.scss +0 -6
  87. data/tests/bootcamp/dist/core/functions/_not-to.scss +0 -5
  88. data/tests/bootcamp/dist/core/functions/_should.scss +0 -6
  89. data/tests/bootcamp/dist/core/functions/_to.scss +0 -5
  90. data/tests/bootcamp/dist/core/mixins/_describe.scss +0 -31
  91. data/tests/bootcamp/dist/core/mixins/_it.scss +0 -31
  92. data/tests/bootcamp/dist/core/mixins/_runner.scss +0 -28
  93. data/tests/bootcamp/dist/core/mixins/_should.scss +0 -46
  94. data/tests/bootcamp/dist/core/mixins/_xdescribe.scss +0 -9
  95. data/tests/bootcamp/dist/core/mixins/_xit.scss +0 -9
  96. data/tests/bootcamp/dist/core/variables/_helpers.scss +0 -5
  97. data/tests/bootcamp/dist/core/variables/_settings.scss +0 -2
  98. data/tests/bootcamp/dist/core/variables/_should.scss +0 -6
  99. data/tests/bootcamp/dist/core/variables/_trackers.scss +0 -6
  100. data/tests/bootcamp/dist/lib/_sassyjson.scss +0 -1075
  101. data/tests/bootcamp/dist/matchers/_be.scss +0 -3
  102. data/tests/bootcamp/dist/matchers/_equal.scss +0 -3
  103. data/tests/bootcamp/dist/matchers/lists/_be-empty.scss +0 -3
  104. data/tests/bootcamp/dist/matchers/lists/_be-longer-than.scss +0 -3
  105. data/tests/bootcamp/dist/matchers/lists/_be-shorter-than.scss +0 -3
  106. data/tests/bootcamp/dist/matchers/lists/_contain.scss +0 -3
  107. data/tests/bootcamp/dist/matchers/lists/_deep-contain.scss +0 -3
  108. data/tests/bootcamp/dist/matchers/lists/_deep-equal.scss +0 -47
  109. data/tests/bootcamp/dist/matchers/lists/_have-length-of.scss +0 -3
  110. data/tests/bootcamp/dist/matchers/numbers/_be-close-to.scss +0 -12
  111. data/tests/bootcamp/dist/matchers/numbers/_be-greater-than.scss +0 -12
  112. data/tests/bootcamp/dist/matchers/numbers/_be-less-than.scss +0 -12
  113. data/tests/bootcamp/dist/matchers/types/_be-falsy.scss +0 -3
  114. data/tests/bootcamp/dist/matchers/types/_be-null.scss +0 -3
  115. data/tests/bootcamp/dist/matchers/types/_be-truthy.scss +0 -3
  116. data/tests/bootcamp/dist/matchers/types/_have-type-of.scss +0 -3
  117. data/tests/bootcamp/dist/utils/_contain.scss +0 -15
  118. data/tests/bootcamp/dist/utils/_equal.scss +0 -23
  119. data/tests/bootcamp/dist/utils/_list-join.scss +0 -35
  120. data/tests/bootcamp/dist/utils/_power.scss +0 -15
  121. data/tests/bootcamp/package.json +0 -63
  122. data/tests/bootcamp/tasks/bootcamp.coffee +0 -83
  123. data/tests/bootcamp/test/core/functions/_actual.scss +0 -10
  124. data/tests/bootcamp/test/core/functions/_expect.scss +0 -6
  125. data/tests/bootcamp/test/core/functions/_not-to.scss +0 -5
  126. data/tests/bootcamp/test/core/functions/_should.scss +0 -10
  127. data/tests/bootcamp/test/core/functions/_to.scss +0 -5
  128. data/tests/bootcamp/test/core/mixins/_describe.scss +0 -11
  129. data/tests/bootcamp/test/core/mixins/_it.scss +0 -5
  130. data/tests/bootcamp/test/core/mixins/_should.scss +0 -5
  131. data/tests/bootcamp/test/core/mixins/_xdescribe.scss +0 -28
  132. data/tests/bootcamp/test/core/mixins/_xit.scss +0 -12
  133. data/tests/bootcamp/test/matchers/_be.scss +0 -90
  134. data/tests/bootcamp/test/matchers/_equal.scss +0 -33
  135. data/tests/bootcamp/test/matchers/lists/_be-empty.scss +0 -12
  136. data/tests/bootcamp/test/matchers/lists/_be-longer-than.scss +0 -29
  137. data/tests/bootcamp/test/matchers/lists/_be-shorter-than.scss +0 -29
  138. data/tests/bootcamp/test/matchers/lists/_contain.scss +0 -39
  139. data/tests/bootcamp/test/matchers/lists/_deep-contain.scss +0 -51
  140. data/tests/bootcamp/test/matchers/lists/_deep-equal.scss +0 -151
  141. data/tests/bootcamp/test/matchers/lists/_have-length-of.scss +0 -31
  142. data/tests/bootcamp/test/matchers/numbers/_be-close-to.scss +0 -24
  143. data/tests/bootcamp/test/matchers/numbers/_be-greater-than.scss +0 -16
  144. data/tests/bootcamp/test/matchers/numbers/_be-less-than.scss +0 -16
  145. data/tests/bootcamp/test/matchers/types/_be-falsy.scss +0 -14
  146. data/tests/bootcamp/test/matchers/types/_be-null.scss +0 -13
  147. data/tests/bootcamp/test/matchers/types/_be-truthy.scss +0 -13
  148. data/tests/bootcamp/test/matchers/types/_have-type-of.scss +0 -17
  149. data/tests/bootcamp/test/specs.scss +0 -45
  150. data/tests/bootcamp/test/utils/_contain.scss +0 -41
  151. data/tests/bootcamp/test/utils/_equal.scss +0 -79
  152. data/tests/bootcamp/test/utils/_list-join.scss +0 -39
  153. data/tests/bootcamp/test/utils/_power.scss +0 -13
  154. data/tests/sass-prof.log +0 -0
@@ -1,14 +1,14 @@
1
- ///
2
- /// HTML encode string
3
- ///
4
- /// @group Internal Functions
5
- ///
6
- @function flint-html-encode($string) {
7
- $encode-map: ("%": "%25", " ": "%20", "!": "%21", '"': "%22", "#": "%23", "$": "%24", "&": "%26", "'": "%27", "(": "%28", ")": "%29", "*": "%2A", "+": "%2B", ",": "%2C", "-": "%2D", ".": "%2E", "/": "%2F", ":": "%3A", ";": "%3B", "<": "%3C", "=": "%3D", ">": "%3E", "?": "%3F", "@": "%40", "[": "%5B", "\\": "%5C", "]": "%5D", "^": "%5E", "_": "%5F", "`": "%60", "{": "%7B", "|": "%7C", "}": "%7D", "~": "%7E", "¢": "%A2", "£": "%A3", "¥": "%A5", "§": "%A7", "«": "%AB", "¬": "%AC", "¯": "%AD", "º": "%B0", "±": "%B1", "ª": "%B2", "µ": "%B5", "»": "%BB", "¼": "%BC", "½": "%BD", "¿": "%BF", "À": "%C0", "Á": "%C1", "Â": "%C2", "Ã": "%C3", "Ä": "%C4", "Å": "%C5", "Æ": "%C6", "Ç": "%C7", "È": "%C8", "É": "%C9", "Ê": "%CA", "Ë": "%CB", "Ì": "%CC", "Í": "%CD", "Î": "%CE", "Ï": "%CF", "Ð": "%D0", "Ñ": "%D1", "Ò": "%D2", "Ó": "%D3", "Ô": "%D4", "Õ": "%D5", "Ö": "%D6", "Ø": "%D8", "Ù": "%D9", "Ú": "%DA", "Û": "%DB", "Ü": "%DC", "Ý": "%DD", "Þ": "%DE", "ß": "%DF", "à": "%E0", "á": "%E1", "â": "%E2", "ã": "%E3", "ä": "%E4", "å": "%E5", "æ": "%E6", "ç": "%E7", "è": "%E8", "é": "%E9", "ê": "%EA", "ë": "%EB", "ì": "%EC", "í": "%ED", "î": "%EE", "ï": "%EF", "ð": "%F0", "ñ": "%F1", "ò": "%F2", "ó": "%F3", "ô": "%F4", "õ": "%F5", "ö": "%F6", "÷": "%F7", "ø": "%F8", "ù": "%F9", "ú": "%FA", "û": "%FB", "ü": "%FC", "ý": "%FD", "þ": "%FE", "ÿ": "%FF");
8
-
9
- @each $search, $replace in $encode-map {
10
- $string: flint-str-replace($string, $search, $replace);
11
- }
12
-
13
- @return $string;
14
- }
1
+ ///
2
+ /// HTML encode string
3
+ ///
4
+ /// @group Internal Functions
5
+ ///
6
+ @function flint-html-encode($string) {
7
+ $encode-map: ("%": "%25", " ": "%20", "!": "%21", '"': "%22", "#": "%23", "$": "%24", "&": "%26", "'": "%27", "(": "%28", ")": "%29", "*": "%2A", "+": "%2B", ",": "%2C", "-": "%2D", ".": "%2E", "/": "%2F", ":": "%3A", ";": "%3B", "<": "%3C", "=": "%3D", ">": "%3E", "?": "%3F", "@": "%40", "[": "%5B", "\\": "%5C", "]": "%5D", "^": "%5E", "_": "%5F", "`": "%60", "{": "%7B", "|": "%7C", "}": "%7D", "~": "%7E", "¢": "%A2", "£": "%A3", "¥": "%A5", "§": "%A7", "«": "%AB", "¬": "%AC", "¯": "%AD", "º": "%B0", "±": "%B1", "ª": "%B2", "µ": "%B5", "»": "%BB", "¼": "%BC", "½": "%BD", "¿": "%BF", "À": "%C0", "Á": "%C1", "Â": "%C2", "Ã": "%C3", "Ä": "%C4", "Å": "%C5", "Æ": "%C6", "Ç": "%C7", "È": "%C8", "É": "%C9", "Ê": "%CA", "Ë": "%CB", "Ì": "%CC", "Í": "%CD", "Î": "%CE", "Ï": "%CF", "Ð": "%D0", "Ñ": "%D1", "Ò": "%D2", "Ó": "%D3", "Ô": "%D4", "Õ": "%D5", "Ö": "%D6", "Ø": "%D8", "Ù": "%D9", "Ú": "%DA", "Û": "%DB", "Ü": "%DC", "Ý": "%DD", "Þ": "%DE", "ß": "%DF", "à": "%E0", "á": "%E1", "â": "%E2", "ã": "%E3", "ä": "%E4", "å": "%E5", "æ": "%E6", "ç": "%E7", "è": "%E8", "é": "%E9", "ê": "%EA", "ë": "%EB", "ì": "%EC", "í": "%ED", "î": "%EE", "ï": "%EF", "ð": "%F0", "ñ": "%F1", "ò": "%F2", "ó": "%F3", "ô": "%F4", "õ": "%F5", "ö": "%F6", "÷": "%F7", "ø": "%F8", "ù": "%F9", "ú": "%FA", "û": "%FB", "ü": "%FC", "ý": "%FD", "þ": "%FE", "ÿ": "%FF");
8
+
9
+ @each $search, $replace in $encode-map {
10
+ $string: flint-str-replace($string, $search, $replace);
11
+ }
12
+
13
+ @return $string;
14
+ }
@@ -1,48 +1,48 @@
1
- ///
2
- /// Keeps count of all instances with arguments, stores in global var
3
- ///
4
- /// @access private
5
- ///
6
- /// @param {String} $key - computed breakpoint of instance
7
- /// @param {Number} $span - computed span of instance
8
- /// @param {Number} $context - computed context of instance
9
- /// @param {Number} $gutter - computed gutter of instance
10
- /// @param {Number} $output-width - computed width of instance
11
- /// @param {Number} $output-margin-right - computed right margin of instance
12
- /// @param {Number} $output-margin-left - computed left margin of instance
13
- ///
14
- /// @return {Map} merged instance map
15
- ///
16
- /// @group Internal Functions
17
- ///
18
- @function flint-instance($key, $span, $context, $gutter, $output-width, $output-margin-right, $output-margin-left) {
19
-
20
- // Increase the instance count
21
- $flint-instance-count: $flint-instance-count + 1 !global;
22
-
23
- // Lets clean up the selector a bit...
24
- $selector: nth(&, 1);
25
-
26
- // Get the selector family instance
27
- $family-instance: flint-has-family-instance($key);
28
-
29
- $flint-instance: (
30
- "#{$selector}::#{$key}": (
31
- "instance-count": $flint-instance-count,
32
- "parent-selector": if($family-instance != false, $family-instance, none),
33
- "key": $key,
34
- "breakpoint": flint-get-value("breakpoints", $key, "breakpoint"),
35
- "columns": flint-get-value("breakpoints", $key, "columns"),
36
- "span": $span,
37
- "context": if($context == "auto", flint-get-instance-value($key, "span"), $context),
38
- "gutter": $gutter,
39
- "internal": (
40
- "width": $output-width,
41
- "margin-right": $output-margin-right,
42
- "margin-left": $output-margin-left
43
- )
44
- )
45
- );
46
-
47
- @return map-merge($flint-instance, $flint-instances);
48
- }
1
+ ///
2
+ /// Keeps count of all instances with arguments, stores in global var
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @param {String} $key - computed breakpoint of instance
7
+ /// @param {Number} $span - computed span of instance
8
+ /// @param {Number} $context - computed context of instance
9
+ /// @param {Number} $gutter - computed gutter of instance
10
+ /// @param {Number} $output-width - computed width of instance
11
+ /// @param {Number} $output-margin-right - computed right margin of instance
12
+ /// @param {Number} $output-margin-left - computed left margin of instance
13
+ ///
14
+ /// @return {Map} merged instance map
15
+ ///
16
+ /// @group Internal Functions
17
+ ///
18
+ @function flint-instance($key, $span, $context, $gutter, $output-width, $output-margin-right, $output-margin-left) {
19
+
20
+ // Increase the instance count
21
+ $flint-instance-count: $flint-instance-count + 1 !global;
22
+
23
+ // Lets clean up the selector a bit...
24
+ $selector: nth(&, 1);
25
+
26
+ // Get the selector family instance
27
+ $family-instance: flint-has-family-instance($key);
28
+
29
+ $flint-instance: (
30
+ "#{$selector}::#{$key}": (
31
+ "instance-count": $flint-instance-count,
32
+ "parent-selector": if($family-instance != false, $family-instance, none),
33
+ "key": $key,
34
+ "breakpoint": flint-get-value("breakpoints", $key, "breakpoint"),
35
+ "columns": flint-get-value("breakpoints", $key, "columns"),
36
+ "span": $span,
37
+ "context": if($context == "auto", flint-get-instance-value($key, "span"), $context),
38
+ "gutter": $gutter,
39
+ "internal": (
40
+ "width": $output-width,
41
+ "margin-right": $output-margin-right,
42
+ "margin-left": $output-margin-left
43
+ )
44
+ )
45
+ );
46
+
47
+ @return map-merge($flint-instance, $flint-instances);
48
+ }
@@ -1,14 +1,14 @@
1
- ///
2
- /// Get last item in list
3
- ///
4
- /// @access private
5
- ///
6
- /// @param {List} $list
7
- ///
8
- /// @return {List}
9
- ///
10
- /// @group Internal Functions
11
- ///
12
- @function flint-last($list) {
13
- @return nth($list, length($list));
14
- }
1
+ ///
2
+ /// Get last item in list
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @param {List} $list
7
+ ///
8
+ /// @return {List}
9
+ ///
10
+ /// @group Internal Functions
11
+ ///
12
+ @function flint-last($list) {
13
+ @return nth($list, length($list));
14
+ }
@@ -1,38 +1,38 @@
1
- ///
2
- /// Joins all elements of list with passed glue
3
- ///
4
- /// @access private
5
- ///
6
- /// @param {List} $list
7
- /// @param {String} $glue
8
- /// @param {Bool} $is-nested
9
- ///
10
- /// @return {String}
11
- ///
12
- /// @group Internal Functions
13
- ///
14
- @function flint-list-to-str($list, $glue: "", $is-nested: false) {
15
- @if flint-is-string($list) {
16
- $list: ($list,);
17
- }
18
-
19
- // Use Ruby function if available
20
- @if $flint-use-ruby-functions {
21
- @return flint_ruby_list_to_str($list, $glue);
22
- }
23
-
24
- $result: "";
25
- $length: length($list);
26
-
27
- @for $i from 1 through $length {
28
- $item: nth($list, $i);
29
-
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
- }
35
- }
36
-
37
- @return quote($result);
38
- }
1
+ ///
2
+ /// Joins all elements of list with passed glue
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @param {List} $list
7
+ /// @param {String} $glue
8
+ /// @param {Bool} $is-nested
9
+ ///
10
+ /// @return {String}
11
+ ///
12
+ /// @group Internal Functions
13
+ ///
14
+ @function flint-list-to-str($list, $glue: "", $is-nested: false) {
15
+ @if flint-is-string($list) {
16
+ $list: ($list,);
17
+ }
18
+
19
+ // Use Ruby function if available
20
+ @if $flint-use-ruby-functions {
21
+ @return flint_ruby_list_to_str($list, $glue);
22
+ }
23
+
24
+ $result: "";
25
+ $length: length($list);
26
+
27
+ @for $i from 1 through $length {
28
+ $item: nth($list, $i);
29
+
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
+ }
35
+ }
36
+
37
+ @return quote($result);
38
+ }
@@ -1,31 +1,31 @@
1
- ///
2
- /// Fetch value from map
3
- ///
4
- /// @access private
5
- ///
6
- /// @param {Map} $map - map to fetch value from
7
- /// @param {ArgList} $keys - list of keys to traverse
8
- ///
9
- /// @return {*}
10
- ///
11
- /// @group Internal Functions
12
- ///
13
- @function flint-map-fetch($map, $keys...) {
14
-
15
- // Use Ruby function if available
16
- @if $flint-use-ruby-functions {
17
- @return flint_ruby_map_fetch($map, $keys...);
18
- }
19
-
20
- $result: $map;
21
-
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
- }
28
- }
29
-
30
- @return $result;
31
- }
1
+ ///
2
+ /// Fetch value from map
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @param {Map} $map - map to fetch value from
7
+ /// @param {ArgList} $keys - list of keys to traverse
8
+ ///
9
+ /// @return {*}
10
+ ///
11
+ /// @group Internal Functions
12
+ ///
13
+ @function flint-map-fetch($map, $keys...) {
14
+
15
+ // Use Ruby function if available
16
+ @if $flint-use-ruby-functions {
17
+ @return flint_ruby_map_fetch($map, $keys...);
18
+ }
19
+
20
+ $result: $map;
21
+
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
+ }
28
+ }
29
+
30
+ @return $result;
31
+ }
@@ -1,14 +1,14 @@
1
- ///
2
- /// Returns next indexed key based on passed index
3
- ///
4
- /// @access private
5
- ///
6
- /// @param {Number} $index - index of breakpoint
7
- ///
8
- /// @return {String}
9
- ///
10
- /// @group Internal Functions
11
- ///
12
- @function flint-next-index($index) {
13
- @return if(flint-is-number($index) and $index != 0, flint-steal-key($index + 1), false);
14
- }
1
+ ///
2
+ /// Returns next indexed key based on passed index
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @param {Number} $index - index of breakpoint
7
+ ///
8
+ /// @return {String}
9
+ ///
10
+ /// @group Internal Functions
11
+ ///
12
+ @function flint-next-index($index) {
13
+ @return if(flint-is-number($index) and $index != 0, flint-steal-key($index + 1), false);
14
+ }
@@ -1,24 +1,24 @@
1
- ///
2
- /// Removes all false and null values from $list
3
- ///
4
- /// @access private
5
- ///
6
- /// @link http://sassylists.com/documentation.html#purge
7
- ///
8
- /// @param {List} $list
9
- ///
10
- /// @return {List}
11
- ///
12
- /// @group Internal Functions
13
- ///
14
- @function flint-purge($list) {
15
- $result: ();
16
-
17
- @each $item in $list {
18
- @if flint-is-true($item) {
19
- $result: append($result, $item, list-separator($list));
20
- }
21
- }
22
-
23
- @return $result;
24
- }
1
+ ///
2
+ /// Removes all false and null values from $list
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @link http://sassylists.com/documentation.html#purge
7
+ ///
8
+ /// @param {List} $list
9
+ ///
10
+ /// @return {List}
11
+ ///
12
+ /// @group Internal Functions
13
+ ///
14
+ @function flint-purge($list) {
15
+ $result: ();
16
+
17
+ @each $item in $list {
18
+ @if flint-is-true($item) {
19
+ $result: append($result, $item, list-separator($list));
20
+ }
21
+ }
22
+
23
+ @return $result;
24
+ }
@@ -1,18 +1,18 @@
1
- ///
2
- /// Remove value from list
3
- ///
4
- /// @access private
5
- ///
6
- /// @link http://sassylists.com/documentation/#remove
7
- ///
8
- /// @param {List} $list
9
- /// @param {*} $value
10
- /// @param {Bool} $recursive
11
- ///
12
- /// @return {List}
13
- ///
14
- /// @group Internal Functions
15
- ///
16
- @function flint-remove($list, $value) {
17
- @return flint-replace($list, $value, null);
18
- }
1
+ ///
2
+ /// Remove value from list
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @link http://sassylists.com/documentation/#remove
7
+ ///
8
+ /// @param {List} $list
9
+ /// @param {*} $value
10
+ /// @param {Bool} $recursive
11
+ ///
12
+ /// @return {List}
13
+ ///
14
+ /// @group Internal Functions
15
+ ///
16
+ @function flint-remove($list, $value) {
17
+ @return flint-replace($list, $value, null);
18
+ }
@@ -1,30 +1,30 @@
1
- ///
2
- /// Replaces old by new in $list
3
- ///
4
- /// @access private
5
- ///
6
- /// @link http://sassylists.com/documentation.html#replace
7
- ///
8
- /// @param {List} $list
9
- /// @param {*} $old
10
- /// @param {*} $value
11
- ///
12
- /// @return {List}
13
- ///
14
- /// @group Internal Functions
15
- ///
16
- @function flint-replace($list, $old, $value) {
17
- $running: true;
18
-
19
- @while $running {
20
- $index: index($list, $old);
21
-
22
- @if not $index {
23
- $running: false;
24
- } @else {
25
- $list: set-nth($list, $index, $value);
26
- }
27
- }
28
-
29
- @return if(not flint-is-true($value), flint-purge($list), $list);
30
- }
1
+ ///
2
+ /// Replaces old by new in $list
3
+ ///
4
+ /// @access private
5
+ ///
6
+ /// @link http://sassylists.com/documentation.html#replace
7
+ ///
8
+ /// @param {List} $list
9
+ /// @param {*} $old
10
+ /// @param {*} $value
11
+ ///
12
+ /// @return {List}
13
+ ///
14
+ /// @group Internal Functions
15
+ ///
16
+ @function flint-replace($list, $old, $value) {
17
+ $running: true;
18
+
19
+ @while $running {
20
+ $index: index($list, $old);
21
+
22
+ @if not $index {
23
+ $running: false;
24
+ } @else {
25
+ $list: set-nth($list, $index, $value);
26
+ }
27
+ }
28
+
29
+ @return if(not flint-is-true($value), flint-purge($list), $list);
30
+ }