flint-gs 1.7.0 → 1.7.1

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.
Files changed (42) hide show
  1. data/LICENSE +21 -21
  2. data/README.md +906 -906
  3. data/lib/flint.rb +77 -77
  4. data/stylesheets/_flint.scss +6 -6
  5. data/stylesheets/flint/config/_config.scss +83 -83
  6. data/stylesheets/flint/functions/_functions.scss +41 -41
  7. data/stylesheets/flint/functions/helpers/_helpers.scss +181 -187
  8. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +33 -33
  9. data/stylesheets/flint/functions/lib/_calc-margin.scss +57 -57
  10. data/stylesheets/flint/functions/lib/_calc-width.scss +50 -50
  11. data/stylesheets/flint/functions/lib/_exists.scss +22 -22
  12. data/stylesheets/flint/functions/lib/_fluid-width.scss +10 -10
  13. data/stylesheets/flint/functions/lib/_get-index.scss +13 -13
  14. data/stylesheets/flint/functions/lib/_get-instance-value.scss +17 -17
  15. data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
  16. data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -74
  17. data/stylesheets/flint/functions/lib/_instance.scss +46 -46
  18. data/stylesheets/flint/functions/lib/_last.scss +9 -9
  19. data/stylesheets/flint/functions/lib/_list-to-string.scss +25 -25
  20. data/stylesheets/flint/functions/lib/_map-fetch.scss +30 -30
  21. data/stylesheets/flint/functions/lib/_next-index.scss +15 -15
  22. data/stylesheets/flint/functions/lib/_purge.scss +19 -19
  23. data/stylesheets/flint/functions/lib/_remove.scss +13 -13
  24. data/stylesheets/flint/functions/lib/_replace-substring.scss +34 -34
  25. data/stylesheets/flint/functions/lib/_replace.scss +25 -25
  26. data/stylesheets/flint/functions/lib/_steal-key.scss +13 -13
  27. data/stylesheets/flint/functions/lib/_steal-values.scss +14 -14
  28. data/stylesheets/flint/functions/lib/_string-to-list.scss +90 -90
  29. data/stylesheets/flint/functions/lib/_string-to-number.scss +77 -77
  30. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +31 -31
  31. data/stylesheets/flint/functions/lib/_support-syntax.scss +28 -28
  32. data/stylesheets/flint/functions/lib/_types-in-list.scss +119 -120
  33. data/stylesheets/flint/functions/lib/_use-syntax.scss +14 -14
  34. data/stylesheets/flint/globals/_globals.scss +38 -38
  35. data/stylesheets/flint/mixins/_mixins.scss +7 -7
  36. data/stylesheets/flint/mixins/lib/_calculate.scss +571 -571
  37. data/stylesheets/flint/mixins/lib/_clearfix.scss +19 -19
  38. data/stylesheets/flint/mixins/lib/_main.scss +935 -935
  39. data/stylesheets/flint/mixins/lib/_new-instance.scss +27 -27
  40. data/stylesheets/flint/mixins/lib/_print-instance.scss +42 -42
  41. metadata +22 -16
  42. checksums.yaml +0 -7
@@ -1,46 +1,46 @@
1
- // Keeps count of all instances with arguments, stores in global var
2
- // -------------------------------------------------------------------------------
3
- // @dependence `flint-get-value()`
4
- // -------------------------------------------------------------------------------
5
- // @param $key [string] : computed breakpoint of instance
6
- // @param $span [number] : computed span of instance
7
- // @param $context [number] : computed context of instance
8
- // @param $gutter [number] : computed gutter of instance
9
- // @param $shift [number] : computed shift of instance
10
- // @param $output-width [number] : computed width of instance
11
- // @param $output-margin-right [number] : computed right margin of instance
12
- // @param $output-margin-left [number] : computed left margin of instance
13
- // -------------------------------------------------------------------------------
14
- // @return instance map
15
-
16
- @function flint-instance($key, $span, $context, $gutter, $shift, $output-width, $output-margin-right, $output-margin-left) {
17
-
18
- // Increase the instance count
19
- $flint__instance-count: $flint__instance-count + 1 !global;
20
-
21
- // Lets clean up the selector a bit...
22
- $selector-string: selector_string();
23
- $selector-list: flint-string-to-list($selector-string);
24
- $selector-cleaned: flint-list-to-string($selector-list, " ");
25
-
26
- $flint__instance: (
27
- "#{$selector-cleaned}::#{$key}": (
28
- "instance-count": #{$flint__instance-count},
29
- "parent-selector": #{if(flint-has-family-instance($key) != false, flint-has-family-instance($key), none)},
30
- "key": #{$key},
31
- "breakpoint": #{flint-get-value($key, "breakpoint")},
32
- "columns": #{flint-get-value($key, "columns")},
33
- "span": #{$span},
34
- "context": #{if($context == "auto", flint-get-instance-value($key, "span"), $context)},
35
- "gutter": #{$gutter},
36
- "shift": #{$shift},
37
- "output": (
38
- "width": #{$output-width},
39
- "margin-right": #{$output-margin-right},
40
- "margin-left": #{$output-margin-left}
41
- )
42
- )
43
- );
44
-
45
- @return map-merge($flint__instances, $flint__instance);
46
- }
1
+ // Keeps count of all instances with arguments, stores in global var
2
+ // -------------------------------------------------------------------------------
3
+ // @dependence `flint-get-value()`
4
+ // -------------------------------------------------------------------------------
5
+ // @param $key [string] : computed breakpoint of instance
6
+ // @param $span [number] : computed span of instance
7
+ // @param $context [number] : computed context of instance
8
+ // @param $gutter [number] : computed gutter of instance
9
+ // @param $shift [number] : computed shift of instance
10
+ // @param $output-width [number] : computed width of instance
11
+ // @param $output-margin-right [number] : computed right margin of instance
12
+ // @param $output-margin-left [number] : computed left margin of instance
13
+ // -------------------------------------------------------------------------------
14
+ // @return instance map
15
+
16
+ @function flint-instance($key, $span, $context, $gutter, $shift, $output-width, $output-margin-right, $output-margin-left) {
17
+
18
+ // Increase the instance count
19
+ $flint__instance-count: $flint__instance-count + 1 !global;
20
+
21
+ // Lets clean up the selector a bit...
22
+ $selector-string: selector_string();
23
+ $selector-list: flint-string-to-list($selector-string);
24
+ $selector-cleaned: flint-list-to-string($selector-list, " ");
25
+
26
+ $flint__instance: (
27
+ "#{$selector-cleaned}::#{$key}": (
28
+ "instance-count": #{$flint__instance-count},
29
+ "parent-selector": #{if(flint-has-family-instance($key) != false, flint-has-family-instance($key), none)},
30
+ "key": #{$key},
31
+ "breakpoint": #{flint-get-value($key, "breakpoint")},
32
+ "columns": #{flint-get-value($key, "columns")},
33
+ "span": #{$span},
34
+ "context": #{if($context == "auto", flint-get-instance-value($key, "span"), $context)},
35
+ "gutter": #{$gutter},
36
+ "shift": #{$shift},
37
+ "output": (
38
+ "width": #{$output-width},
39
+ "margin-right": #{$output-margin-right},
40
+ "margin-left": #{$output-margin-left}
41
+ )
42
+ )
43
+ );
44
+
45
+ @return map-merge($flint__instances, $flint__instance);
46
+ }
@@ -1,9 +1,9 @@
1
- // Get last item in list
2
- // -------------------------------------------------------------------------------
3
- // @param $list [list] : list
4
- // -------------------------------------------------------------------------------
5
- // @return [list]
6
-
7
- @function flint-last($list) {
8
- @return nth($list, length($list));
9
- }
1
+ // Get last item in list
2
+ // -------------------------------------------------------------------------------
3
+ // @param $list [list] : list
4
+ // -------------------------------------------------------------------------------
5
+ // @return [list]
6
+
7
+ @function flint-last($list) {
8
+ @return nth($list, length($list));
9
+ }
@@ -1,25 +1,25 @@
1
- // Joins all elements of $list with $glue
2
- // -------------------------------------------------------------------------------
3
- // @documentation http://sassylists.com/documentation/#to-string
4
- // -------------------------------------------------------------------------------
5
- // @param $list [list] : list
6
- // @param $glue [string] : value to use as a join string
7
- // -------------------------------------------------------------------------------
8
- // @return [string]
9
-
10
- @function flint-list-to-string($list, $glue: "", $is-nested: false) {
11
- $result: null;
12
- $length: length($list);
13
-
14
- @for $i from 1 through $length {
15
- $n: nth($list, $i);
16
-
17
- @if flint-is-list($n) {
18
- $result: $result#{flint-list-to-string($n, $glue, true)};
19
- } @else {
20
- $result: if($i != length($list) or $is-nested, $result#{$n}#{$glue}, $result#{$n});
21
- }
22
- }
23
-
24
- @return $result;
25
- }
1
+ // Joins all elements of $list with $glue
2
+ // -------------------------------------------------------------------------------
3
+ // @documentation http://sassylists.com/documentation/#to-string
4
+ // -------------------------------------------------------------------------------
5
+ // @param $list [list] : list
6
+ // @param $glue [string] : value to use as a join string
7
+ // -------------------------------------------------------------------------------
8
+ // @return [string]
9
+
10
+ @function flint-list-to-string($list, $glue: "", $is-nested: false) {
11
+ $result: null;
12
+ $length: length($list);
13
+
14
+ @for $i from 1 through $length {
15
+ $n: nth($list, $i);
16
+
17
+ @if flint-is-list($n) {
18
+ $result: $result#{flint-list-to-string($n, $glue, true)};
19
+ } @else {
20
+ $result: if($i != length($list) or $is-nested, $result#{$n}#{$glue}, $result#{$n});
21
+ }
22
+ }
23
+
24
+ @return $result;
25
+ }
@@ -1,30 +1,30 @@
1
- // Fetch value from key in map
2
- // -------------------------------------------------------------------------------
3
- // @param $map [map] : map to fetch from
4
- // @param $keys [string | list] : string of key, or list of strings
5
- // -------------------------------------------------------------------------------
6
- // @return fetched literal | false
7
-
8
- @function flint-map-fetch($map, $keys) {
9
- $key: nth($keys, 1);
10
- $length: length($keys);
11
- $value: map-get($map, $key);
12
-
13
- @if $value != null {
14
- @if $length > 1 {
15
- $rest: ();
16
-
17
- @for $i from 2 through $length {
18
- $rest: append($rest, nth($keys, $i))
19
- }
20
-
21
- @return flint-map-fetch($value, $rest);
22
-
23
- } @else {
24
- @return $value;
25
- }
26
- } @else {
27
- @warn "Invalid arguments passed to function: flint-map-fetch(#{$map}, #{$keys}). One or more of the keys do not exist.";
28
- @return false;
29
- }
30
- }
1
+ // Fetch value from key in map
2
+ // -------------------------------------------------------------------------------
3
+ // @param $map [map] : map to fetch from
4
+ // @param $keys [string | list] : string of key, or list of strings
5
+ // -------------------------------------------------------------------------------
6
+ // @return fetched literal | false
7
+
8
+ @function flint-map-fetch($map, $keys) {
9
+ $key: nth($keys, 1);
10
+ $length: length($keys);
11
+ $value: map-get($map, $key);
12
+
13
+ @if $value != null {
14
+ @if $length > 1 {
15
+ $rest: ();
16
+
17
+ @for $i from 2 through $length {
18
+ $rest: append($rest, nth($keys, $i))
19
+ }
20
+
21
+ @return flint-map-fetch($value, $rest);
22
+
23
+ } @else {
24
+ @return $value;
25
+ }
26
+ } @else {
27
+ @warn "Invalid arguments passed to function: flint-map-fetch(#{$map}, #{$keys}). One or more of the keys do not exist.";
28
+ @return false;
29
+ }
30
+ }
@@ -1,15 +1,15 @@
1
- // Returns next indexed key based on passed index
2
- // -------------------------------------------------------------------------------
3
- // @param $index [number] : index
4
- // -------------------------------------------------------------------------------
5
- // @return [string] | null
6
-
7
- @function flint-next-index($index) {
8
- @if $index != (length(flint-map-fetch($flint, "config")) - 1) {
9
- @each $key in nth(map-get($flint, "config"), $index + 1) {
10
- @return $key;
11
- }
12
- } @else {
13
- @return null;
14
- }
15
- }
1
+ // Returns next indexed key based on passed index
2
+ // -------------------------------------------------------------------------------
3
+ // @param $index [number] : index
4
+ // -------------------------------------------------------------------------------
5
+ // @return [string] | null
6
+
7
+ @function flint-next-index($index) {
8
+ @if $index != (length(flint-map-fetch($flint, "config")) - 1) {
9
+ @each $key in nth(map-get($flint, "config"), $index + 1) {
10
+ @return $key;
11
+ }
12
+ } @else {
13
+ @return null;
14
+ }
15
+ }
@@ -1,19 +1,19 @@
1
- // Removes all false and null values from $list
2
- // -------------------------------------------------------------------------------
3
- // @documentation http://sassylists.com/documentation.html#purge
4
- // -------------------------------------------------------------------------------
5
- // @param $list [list] : list
6
- // -------------------------------------------------------------------------------
7
- // @return [list]
8
-
9
- @function flint-purge($list) {
10
- $result: ();
11
-
12
- @each $item in $list {
13
- @if flint-is-true($item) {
14
- $result: append($result, $item, list-separator($list));
15
- }
16
- }
17
-
18
- @return $result;
19
- }
1
+ // Removes all false and null values from $list
2
+ // -------------------------------------------------------------------------------
3
+ // @documentation http://sassylists.com/documentation.html#purge
4
+ // -------------------------------------------------------------------------------
5
+ // @param $list [list] : list
6
+ // -------------------------------------------------------------------------------
7
+ // @return [list]
8
+
9
+ @function flint-purge($list) {
10
+ $result: ();
11
+
12
+ @each $item in $list {
13
+ @if flint-is-true($item) {
14
+ $result: append($result, $item, list-separator($list));
15
+ }
16
+ }
17
+
18
+ @return $result;
19
+ }
@@ -1,13 +1,13 @@
1
- // Remove $value from $list
2
- // -------------------------------------------------------------------------------
3
- // @documentation http://sassylists.com/documentation/#remove
4
- // -------------------------------------------------------------------------------
5
- // @param $list [list] : list
6
- // @param $value [literal] : value to flint-remove
7
- // @param $recursive [bool] : enable / disable recursivity
8
- // -------------------------------------------------------------------------------
9
- // @return [list]
10
-
11
- @function flint-remove($list, $value) {
12
- @return flint-replace($list, $value, null);
13
- }
1
+ // Remove $value from $list
2
+ // -------------------------------------------------------------------------------
3
+ // @documentation http://sassylists.com/documentation/#remove
4
+ // -------------------------------------------------------------------------------
5
+ // @param $list [list] : list
6
+ // @param $value [literal] : value to flint-remove
7
+ // @param $recursive [bool] : enable / disable recursivity
8
+ // -------------------------------------------------------------------------------
9
+ // @return [list]
10
+
11
+ @function flint-remove($list, $value) {
12
+ @return flint-replace($list, $value, null);
13
+ }
@@ -1,34 +1,34 @@
1
- // Replace substring
2
- // -------------------------------------------------------------------------------
3
- // @param $string [string] : string that contains substring
4
- // @param $substring [string] : substring to replace
5
- // @param $new-substring [string] : new string to replace sub with
6
- // -------------------------------------------------------------------------------
7
- // @return [string]
8
-
9
- @function flint-replace-substring($string, $substring, $new-substring: " ") {
10
-
11
- // Use Ruby function if available
12
- @if $flint__use-ruby-functions {
13
- @return replace_substring($string, $substring, $new-substring);
14
- } @else {
15
- // Loop through length of string
16
- @for $i from 1 through str-length($string) {
17
- // Get index and length of substring
18
- $sub-index: str-index($string, $substring);
19
- $sub-length: str-length($substring);
20
-
21
- // If count is index of substring
22
- @if $i == $sub-index {
23
- // Slice string to exclude substring
24
- $string-before: str-slice($string, 1, $i - 1);
25
- $string-after: str-slice($string, $i + $sub-length, str-length($string));
26
- // Create new string
27
- $string: $string-before + $new-substring + $string-after;
28
- }
29
-
30
- }
31
-
32
- @return $string;
33
- }
34
- }
1
+ // Replace substring
2
+ // -------------------------------------------------------------------------------
3
+ // @param $string [string] : string that contains substring
4
+ // @param $substring [string] : substring to replace
5
+ // @param $new-substring [string] : new string to replace sub with
6
+ // -------------------------------------------------------------------------------
7
+ // @return [string]
8
+
9
+ @function flint-replace-substring($string, $substring, $new-substring: " ") {
10
+
11
+ // Use Ruby function if available
12
+ @if $flint__use-ruby-functions {
13
+ @return replace_substring($string, $substring, $new-substring);
14
+ } @else {
15
+ // Loop through length of string
16
+ @for $i from 1 through str-length($string) {
17
+ // Get index and length of substring
18
+ $sub-index: str-index($string, $substring);
19
+ $sub-length: str-length($substring);
20
+
21
+ // If count is index of substring
22
+ @if $i == $sub-index {
23
+ // Slice string to exclude substring
24
+ $string-before: str-slice($string, 1, $i - 1);
25
+ $string-after: str-slice($string, $i + $sub-length, str-length($string));
26
+ // Create new string
27
+ $string: $string-before + $new-substring + $string-after;
28
+ }
29
+
30
+ }
31
+
32
+ @return $string;
33
+ }
34
+ }
@@ -1,25 +1,25 @@
1
- // Replaces $old by $new in $list
2
- // -------------------------------------------------------------------------------
3
- // @documentation http://sassylists.com/documentation.html#replace
4
- // -------------------------------------------------------------------------------
5
- // @param $list [list] : list
6
- // @param $old [literal] : value to replace
7
- // @param $value [literal] : new value for $old
8
- // -------------------------------------------------------------------------------
9
- // @return [list]
10
-
11
- @function flint-replace($list, $old, $value) {
12
- $running: true;
13
-
14
- @while $running {
15
- $index: index($list, $old);
16
-
17
- @if not $index {
18
- $running: false;
19
- } @else {
20
- $list: set-nth($list, $index, $value);
21
- }
22
- }
23
-
24
- @return if(not flint-is-true($value), flint-purge($list), $list);
25
- }
1
+ // Replaces $old by $new in $list
2
+ // -------------------------------------------------------------------------------
3
+ // @documentation http://sassylists.com/documentation.html#replace
4
+ // -------------------------------------------------------------------------------
5
+ // @param $list [list] : list
6
+ // @param $old [literal] : value to replace
7
+ // @param $value [literal] : new value for $old
8
+ // -------------------------------------------------------------------------------
9
+ // @return [list]
10
+
11
+ @function flint-replace($list, $old, $value) {
12
+ $running: true;
13
+
14
+ @while $running {
15
+ $index: index($list, $old);
16
+
17
+ @if not $index {
18
+ $running: false;
19
+ } @else {
20
+ $list: set-nth($list, $index, $value);
21
+ }
22
+ }
23
+
24
+ @return if(not flint-is-true($value), flint-purge($list), $list);
25
+ }
@@ -1,13 +1,13 @@
1
- // Steal key based on index number
2
- //--------------------------------------------------------------------------------
3
- // @param $index [number] : index of key
4
- // -------------------------------------------------------------------------------
5
- // @return [string]
6
-
7
- @function flint-steal-key($index) {
8
- @for $n from 1 through (length(flint-map-fetch($flint, "config")) - 1) {
9
- @each $key in nth(map-get($flint, "config"), $index) {
10
- @return $key;
11
- }
12
- }
13
- }
1
+ // Steal key based on index number
2
+ //--------------------------------------------------------------------------------
3
+ // @param $index [number] : index of key
4
+ // -------------------------------------------------------------------------------
5
+ // @return [string]
6
+
7
+ @function flint-steal-key($index) {
8
+ @for $n from 1 through (length(flint-map-fetch($flint, "config")) - 1) {
9
+ @each $key in nth(map-get($flint, "config"), $index) {
10
+ @return $key;
11
+ }
12
+ }
13
+ }