flint-gs 1.6.2 → 1.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea0073e3515246e3c814e48143e051115aa6acf3
4
- data.tar.gz: 7b7a23b934e5438a093c42eee716b6a50d6fc5fe
3
+ metadata.gz: e7237e782b4c94642d2476f469a73f69bb2b8706
4
+ data.tar.gz: 711ed0e151e8e5bd31b9ec158eca87eebd1e8d6f
5
5
  SHA512:
6
- metadata.gz: bacc7d66d3d0e733dfd1dc10e4b1bd45a7f7383225d759a56720886dadfb9bd9fff60182e87d143542248050bf0c4e7c2aa0a0a13e52dc40e7f2b143aa27bb54
7
- data.tar.gz: 7195dc01e2d35c33bad0224075c6737b3ae7e116d54e14f1ad9fe7d5c34fd61994e637482de4ad9ecb8236a05419458d4449e034749256a52a13b0d195f5b6e1
6
+ metadata.gz: 9ac60c7a3e67f7fd08e39ee5f104acb6f46836767af8478941ec3b28772640dc51050987d258c399a7ab0fc99fc2914c4e4b7e075c4b0bdf0568f0b81010ec36
7
+ data.tar.gz: d67df883bb8d0bfed43c79ab2b1f860951640369e6c203a045c39705e351c38170d75f33735faf95fa49bfeb987f7d9f19cb6ca001e7d532c4065bd94d503f31
data/lib/flint.rb CHANGED
@@ -5,8 +5,8 @@ Compass::Frameworks.register('flint', :path => extension_path)
5
5
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
6
6
  # Date is in the form of YYYY-MM-DD
7
7
  module Flint
8
- VERSION = "1.6.2"
9
- DATE = "2014-07-03"
8
+ VERSION = "1.6.3"
9
+ DATE = "2014-07-08"
10
10
  end
11
11
 
12
12
  # Custom functions
@@ -9,7 +9,6 @@
9
9
  @import "lib/map-fetch";
10
10
  @import "lib/get-value";
11
11
  @import "lib/get-index";
12
- @import "lib/get-substring";
13
12
  @import "lib/steal-key";
14
13
  @import "lib/steal-values";
15
14
  // Calculations
@@ -30,6 +29,7 @@
30
29
  @import "lib/remove";
31
30
  @import "lib/last";
32
31
  // String functions
32
+ @import "lib/replace-substring";
33
33
  @import "lib/string-to-number";
34
34
  @import "lib/string-to-list";
35
35
 
@@ -1,12 +1,6 @@
1
1
  // Calculate from-to breakpoints
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `map-fetch()`
4
- // @dependence `get-value()`
5
- // @dependence `steal-key()`
6
- // @dependence `is-highest-breakpoint()`
7
- // @dependence `is-lowest-breakpoint()`
8
- // -------------------------------------------------------------------------------
9
- // @param $n [string] : how to calculate breakpoint
3
+ // @param $n [string] : how to calculate breakpoint
10
4
  // @param $key [string] : key of breakpoint
11
5
  // @param $i [number] : index of current breakpoint
12
6
  // -------------------------------------------------------------------------------
@@ -36,4 +30,4 @@
36
30
  @return get-value(steal-key(($i - 1)), "breakpoint");
37
31
  }
38
32
  }
39
- }
33
+ }
@@ -1,8 +1,5 @@
1
1
  // Calculate margin
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `get-value()`
4
- // @dependence `fluid-width()`
5
- // -------------------------------------------------------------------------------
6
3
  // @param $key [string] : key for lookup
7
4
  // @param $span [number] : span value of element
8
5
  // @param $context [number] : context value of element
@@ -29,4 +26,4 @@
29
26
  } @else {
30
27
  @return false;
31
28
  }
32
- }
29
+ }
@@ -1,8 +1,5 @@
1
1
  // Calculate width
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `get-value()`
4
- // @dependence `fluid-width()`
5
- // -------------------------------------------------------------------------------
6
3
  // @param $key [string] : key for lookup
7
4
  // @param $span [number] : span value of element
8
5
  // @param $context [number] : context value of element
@@ -1,7 +1,5 @@
1
1
  // Gets the index of the passed key
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `steal-key()`
4
- // -------------------------------------------------------------------------------
5
3
  // @param $key [string] : breakpoint key
6
4
  // -------------------------------------------------------------------------------
7
5
  // @return [number]
@@ -12,4 +10,4 @@
12
10
  @return $i;
13
11
  }
14
12
  }
15
- }
13
+ }
@@ -1,7 +1,5 @@
1
1
  // Get single value from key in instance map based on $selector::$key
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `map-fetch()`
4
- // -------------------------------------------------------------------------------
5
3
  // @warning : all values @returned are strings and must be converted with `to-number()`
6
4
  // -------------------------------------------------------------------------------
7
5
  // @param $key [string] : key
@@ -1,7 +1,5 @@
1
1
  // Get single value from key in instance map based on $selector::$key
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `map-fetch()`
4
- // -------------------------------------------------------------------------------
5
3
  // @param $key [string] : breakpoint key
6
4
  // @param $value [string] : key of value
7
5
  // -------------------------------------------------------------------------------
@@ -35,10 +35,10 @@
35
35
  "output": (
36
36
  "width": #{$outputWidth},
37
37
  "margin-right": #{$outputMarginRight},
38
- "margin-left": #{$outputMarginLeft},
39
- ),
40
- ),
38
+ "margin-left": #{$outputMarginLeft}
39
+ )
40
+ )
41
41
  );
42
-
42
+
43
43
  @return map-merge($flint__instances, $flint__instance);
44
- }
44
+ }
@@ -2,8 +2,6 @@
2
2
  // -------------------------------------------------------------------------------
3
3
  // @documentation http://sassylists.com/documentation.html#purge
4
4
  // -------------------------------------------------------------------------------
5
- // @dependence `is-true()`
6
- // -------------------------------------------------------------------------------
7
5
  // @param $list [list] : list
8
6
  // -------------------------------------------------------------------------------
9
7
  // @return [list]
@@ -18,4 +16,4 @@
18
16
  }
19
17
 
20
18
  @return $result;
21
- }
19
+ }
@@ -2,8 +2,6 @@
2
2
  // -------------------------------------------------------------------------------
3
3
  // @documentation http://sassylists.com/documentation/#remove
4
4
  // -------------------------------------------------------------------------------
5
- // @dependence `replace()`
6
- // -------------------------------------------------------------------------------
7
5
  // @param $list [list] : list
8
6
  // @param $value [literal] : value to remove
9
7
  // @param $recursive [bool] : enable / disable recursivity
@@ -12,4 +10,4 @@
12
10
 
13
11
  @function remove($list, $value) {
14
12
  @return replace($list, $value, null);
15
- }
13
+ }
@@ -0,0 +1,36 @@
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
+ // @param $recursive [bool] : recursively replace all substrings
7
+ // -------------------------------------------------------------------------------
8
+ // @return [string]
9
+
10
+ @function replace-substring($string, $substring, $new-substring: " ", $recursive: true) {
11
+ // Loop through length of string
12
+ @for $i from 1 through str-length($string) {
13
+
14
+ // Get index and length of substring
15
+ $sub-index: str-index($string, $substring);
16
+ $sub-length: str-length($substring);
17
+
18
+ // If count is index of substring
19
+ @if $i == $sub-index {
20
+
21
+ // Slice string to exclude substring
22
+ $string-before: str-slice($string, 1, $i - 1);
23
+ $string-after: str-slice($string, $i + $sub-length, str-length($string));
24
+
25
+ // Create new string
26
+ $string: $string-before + $new-substring + $string-after;
27
+
28
+ @if $recursive {
29
+ $string: replace-substring($string, $substring, $new-substring);
30
+ }
31
+ }
32
+
33
+ }
34
+
35
+ @return $string;
36
+ }
@@ -1,8 +1,5 @@
1
1
  // Steal value based on index number
2
2
  // -------------------------------------------------------------------------------
3
- // @dependence `map-fetch()`
4
- // @dependence `get-value()`
5
- // -------------------------------------------------------------------------------
6
3
  // @param $index [number] : index of breakpoint key in config
7
4
  // @param $value [number] : value
8
5
  // -------------------------------------------------------------------------------
@@ -14,4 +11,4 @@
14
11
  @return get-value($key, $value);
15
12
  }
16
13
  }
17
- }
14
+ }
@@ -5,8 +5,13 @@
5
5
  // @return [list] : parsed list of selectors according to syntax
6
6
 
7
7
  @function support-syntax-bem($selectors) {
8
- $selectors: string-to-list($selectors, "_");
8
+ // Clean up selector, remove double underscores for spaces
9
+ $selectors: replace-substring($selectors, "__");
10
+ // Parse string to list
11
+ $selectors: string-to-list($selectors);
12
+ // Define top-most parent of selector
9
13
  $parent: nth($selectors, 1);
14
+ // Create new list of parsed selectors
10
15
  $selector-list: ($parent);
11
16
 
12
17
  // Loop over each selector and build list of selectors
@@ -11,8 +11,8 @@
11
11
  $selector-string: selector_string();
12
12
  $selector-list: string-to-list($selector-string);
13
13
  $selector-cleaned: list-to-string($selector-list, " ");
14
-
15
- @if get-value(settings, debug-mode) == true {
14
+
15
+ @if get-value(settings, debug-mode) {
16
16
  $printKey: "#{$selector-cleaned}" + "::" + "#{$calcKey}";
17
17
  @include printInstance( map-get( $flint__instances, unquote($printKey) ) );
18
18
  }
@@ -39,4 +39,4 @@
39
39
  -flint-#{$property}: #{$value};
40
40
  }
41
41
  }
42
- }
42
+ }
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.2
4
+ version: 1.6.3
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-03 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -61,7 +61,6 @@ files:
61
61
  - stylesheets/flint/functions/lib/_get-family-instance.scss
62
62
  - stylesheets/flint/functions/lib/_get-index.scss
63
63
  - stylesheets/flint/functions/lib/_get-instance-value.scss
64
- - stylesheets/flint/functions/lib/_get-substring.scss
65
64
  - stylesheets/flint/functions/lib/_get-value.scss
66
65
  - stylesheets/flint/functions/lib/_instance.scss
67
66
  - stylesheets/flint/functions/lib/_last.scss
@@ -70,6 +69,7 @@ files:
70
69
  - stylesheets/flint/functions/lib/_next-index.scss
71
70
  - stylesheets/flint/functions/lib/_purge.scss
72
71
  - stylesheets/flint/functions/lib/_remove.scss
72
+ - stylesheets/flint/functions/lib/_replace-substring.scss
73
73
  - stylesheets/flint/functions/lib/_replace.scss
74
74
  - stylesheets/flint/functions/lib/_steal-key.scss
75
75
  - stylesheets/flint/functions/lib/_steal-values.scss
@@ -1,24 +0,0 @@
1
- // Gets substring from string
2
- // -------------------------------------------------------------------------------
3
- // @dependence `string-to-list()`
4
- // -------------------------------------------------------------------------------
5
- // @param $full-string [string] : string that contains substring
6
- // @param $depth [number | string] : depth of substring
7
- // -------------------------------------------------------------------------------
8
- // @return [string]
9
-
10
- @function get-substring($full-string, $depth) {
11
- @if is-string($full-string) {
12
- $get-substring: string-to-list($full-string);
13
-
14
- @if $depth == "last" {
15
- @return nth($get-substring, length($get-substring));
16
- } @else if $depth == "first" {
17
- @return nth($get-substring, 1);
18
- } @else {
19
- @return nth($get-substring, $depth);
20
- }
21
- } @else {
22
- @return "You did not input a valid string: #{$full-string}";
23
- }
24
- }