flint-gs 1.6.5 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -13
  3. data/lib/flint.rb +64 -4
  4. data/stylesheets/flint/config/_config.scss +3 -3
  5. data/stylesheets/flint/functions/_functions.scss +1 -1
  6. data/stylesheets/flint/functions/helpers/_helpers.scss +32 -23
  7. data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +11 -11
  8. data/stylesheets/flint/functions/lib/_calc-margin.scss +40 -12
  9. data/stylesheets/flint/functions/lib/_calc-width.scss +21 -12
  10. data/stylesheets/flint/functions/lib/_exists.scss +6 -6
  11. data/stylesheets/flint/functions/lib/_fluid-width.scss +2 -2
  12. data/stylesheets/flint/functions/lib/_get-index.scss +3 -3
  13. data/stylesheets/flint/functions/lib/_get-instance-value.scss +4 -4
  14. data/stylesheets/flint/functions/lib/_get-value.scss +3 -3
  15. data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -0
  16. data/stylesheets/flint/functions/lib/_instance.scss +17 -15
  17. data/stylesheets/flint/functions/lib/_last.scss +2 -2
  18. data/stylesheets/flint/functions/lib/_list-to-string.scss +4 -4
  19. data/stylesheets/flint/functions/lib/_map-fetch.scss +6 -9
  20. data/stylesheets/flint/functions/lib/_next-index.scss +3 -3
  21. data/stylesheets/flint/functions/lib/_purge.scss +2 -2
  22. data/stylesheets/flint/functions/lib/_remove.scss +4 -4
  23. data/stylesheets/flint/functions/lib/_replace-substring.scss +21 -15
  24. data/stylesheets/flint/functions/lib/_replace.scss +3 -3
  25. data/stylesheets/flint/functions/lib/_steal-key.scss +3 -3
  26. data/stylesheets/flint/functions/lib/_steal-values.scss +3 -3
  27. data/stylesheets/flint/functions/lib/_string-to-list.scss +63 -57
  28. data/stylesheets/flint/functions/lib/_string-to-number.scss +42 -38
  29. data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +3 -3
  30. data/stylesheets/flint/functions/lib/_support-syntax.scss +4 -4
  31. data/stylesheets/flint/functions/lib/_types-in-list.scss +3 -3
  32. data/stylesheets/flint/functions/lib/_use-syntax.scss +3 -3
  33. data/stylesheets/flint/globals/_globals.scss +20 -4
  34. data/stylesheets/flint/mixins/lib/_calculate.scss +368 -563
  35. data/stylesheets/flint/mixins/lib/_clearfix.scss +7 -7
  36. data/stylesheets/flint/mixins/lib/_main.scss +244 -244
  37. data/stylesheets/flint/mixins/lib/_new-instance.scss +20 -20
  38. data/stylesheets/flint/mixins/lib/_print-instance.scss +14 -14
  39. metadata +3 -3
  40. data/stylesheets/flint/functions/lib/_get-family-instance.scss +0 -59
@@ -1,27 +1,27 @@
1
1
  // Creates a new instance, adds to global instance map
2
2
  // -------------------------------------------------------------------------------
3
- // @param $calcKey [string] : breakpoint key
4
- // @param $calcSpan [number] : span
5
- // @param $calcContext [number] : context
6
- // @param $calcGutter [number] : gutter
7
- // @param $calcShift [number] : shift
8
- // @param $outputWidth [number] : width
9
- // @param $outputMarginRight [number] : right margin
10
- // @param $outputMarginLeft [number] : left margin
3
+ // @param $calc-key [string] : breakpoint key
4
+ // @param $calc-span [number] : span
5
+ // @param $calc-context [number] : context
6
+ // @param $calc-gutter [number] : gutter
7
+ // @param $calc-shift [number] : shift
8
+ // @param $output-width [number] : width
9
+ // @param $output-margin-right [number] : right margin
10
+ // @param $output-margin-left [number] : left margin
11
11
  // -------------------------------------------------------------------------------
12
12
  // @output new instance map
13
13
 
14
- @mixin newInstance ($calcKey, $calcSpan, $calcContext, $calcGutter, $calcShift, $outputWidth, $outputMarginRight, $outputMarginLeft) {
15
- $flint__instances:
16
- instance(
17
- $calcKey,
18
- $calcSpan,
19
- $calcContext,
20
- $calcGutter,
21
- $calcShift,
22
- $outputWidth,
23
- $outputMarginRight,
24
- $outputMarginLeft
14
+ @mixin flint-new-instance($calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $output-width, $output-margin-right, $output-margin-left) {
15
+ $flint__instances:
16
+ flint-instance(
17
+ $calc-key,
18
+ $calc-span,
19
+ $calc-context,
20
+ $calc-gutter,
21
+ $calc-shift,
22
+ $output-width,
23
+ $output-margin-right,
24
+ $output-margin-left
25
25
  )
26
26
  !global;
27
- }
27
+ }
@@ -1,20 +1,20 @@
1
1
  // Prints debug properties
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `printInstance()`
3
+ // @dependence `flint-print-instance()`
4
4
  // -------------------------------------------------------------------------------
5
- // @param $calcKey [string] : breakpoint key to search for instance
5
+ // @param $calc-key [string] : breakpoint key to search for instance
6
6
  // -------------------------------------------------------------------------------
7
7
  // @output instance map
8
8
 
9
- @mixin debugPrintInstance($calcKey) {
10
- // Lets clean up the selector a bit...
11
- $selector-string: selector_string();
12
- $selector-list: string-to-list($selector-string);
13
- $selector-cleaned: list-to-string($selector-list, " ");
9
+ @mixin flint-debug-instance($calc-key) {
10
+ @if flint-get-value("settings", "debug-mode") {
11
+ // Lets clean up the selector a bit...
12
+ $selector-string: selector_string();
13
+ $selector-list: flint-string-to-list($selector-string);
14
+ $selector-cleaned: flint-list-to-string($selector-list, " ");
14
15
 
15
- @if get-value(settings, debug-mode) {
16
- $printKey: "#{$selector-cleaned}" + "::" + "#{$calcKey}";
17
- @include printInstance( map-get( $flint__instances, unquote($printKey) ) );
16
+ $printKey: "#{$selector-cleaned}" + "::" + "#{$calc-key}";
17
+ @include flint-print-instance( map-get( $flint__instances, unquote($printKey) ) );
18
18
  }
19
19
  }
20
20
 
@@ -24,15 +24,15 @@
24
24
  // -------------------------------------------------------------------------------
25
25
  // @output instance map
26
26
 
27
- @mixin printInstance($instance) {
27
+ @mixin flint-print-instance($instance) {
28
28
 
29
29
  // Loop through each property in passed instance
30
30
  @each $property, $value in $instance {
31
31
 
32
32
  // Check if value is output map
33
- @if is-map($value) {
34
- @each $mod_property, $mod_value in $value {
35
- -flint-output-#{$mod_property}: #{$mod_value};
33
+ @if flint-is-map($value) {
34
+ @each $p, $v in $value {
35
+ -flint-output-#{$p}: #{$v};
36
36
  }
37
37
  // Else, print values as flagged comments
38
38
  } @else {
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: 1.6.5
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-08 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -58,10 +58,10 @@ files:
58
58
  - stylesheets/flint/functions/lib/_calc-width.scss
59
59
  - stylesheets/flint/functions/lib/_exists.scss
60
60
  - stylesheets/flint/functions/lib/_fluid-width.scss
61
- - stylesheets/flint/functions/lib/_get-family-instance.scss
62
61
  - stylesheets/flint/functions/lib/_get-index.scss
63
62
  - stylesheets/flint/functions/lib/_get-instance-value.scss
64
63
  - stylesheets/flint/functions/lib/_get-value.scss
64
+ - stylesheets/flint/functions/lib/_has-family-instance.scss
65
65
  - stylesheets/flint/functions/lib/_instance.scss
66
66
  - stylesheets/flint/functions/lib/_last.scss
67
67
  - stylesheets/flint/functions/lib/_list-to-string.scss
@@ -1,59 +0,0 @@
1
- // Checks if instance exists in selector familiy tree, falls back from current selector
2
- // -------------------------------------------------------------------------------
3
- // @param $key [string] : breakpoint key to search for matching instance
4
- // @param $syntax [string | null] : searches for instance using passed syntax
5
- // -------------------------------------------------------------------------------
6
- // @return matching instance | false
7
-
8
- @function get-family-instance($key: get-value("settings", "default"), $syntax: $flint__support-syntax) {
9
- $selector-string: selector_string();
10
-
11
- // Check for syntax support, try to find instance using it
12
- @if $syntax {
13
- $selector-list: use-syntax($selector-string);
14
- $length: length($selector-list);
15
-
16
- // Loop through transformed selectors
17
- @for $i from 1 through $length {
18
-
19
- // Check last selector in list
20
- @if exists($flint__instances, "#{last($selector-list)}::#{$key}") {
21
-
22
- // Return the matching instance key
23
- @return "#{last($selector-list)}::#{$key}";
24
-
25
- } @else {
26
-
27
- // Else, remove the last selector and loop again
28
- $selector-list: remove($selector-list, last($selector-list));
29
-
30
- }
31
- }
32
-
33
- // Search for a parent instance normally
34
- @return get-family-instance($key, null);
35
-
36
- } @else {
37
- $selector-list: string-to-list($selector-string);
38
- $length: length($selector-list);
39
-
40
- // Loop through length of list of selectors
41
- @for $i from 1 through $length {
42
-
43
- // Make sure that we're not counting the current selector string
44
- @if exists($flint__instances, "#{list-to-string($selector-list, " ")}::#{$key}") and $selector-string != list-to-string($selector-list, " ") {
45
-
46
- // Return the matching instance key
47
- @return "#{list-to-string($selector-list, " ")}::#{$key}";
48
-
49
- } @else {
50
-
51
- // Else, remove the last selector and loop again
52
- $selector-list: remove($selector-list, last($selector-list));
53
-
54
- }
55
- }
56
-
57
- @return false;
58
- }
59
- }