flint-gs 1.6.3 → 1.6.4
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/README.md +6 -1
- data/lib/flint.rb +1 -1
- data/stylesheets/flint/functions/lib/_replace-substring.scss +4 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6705aa106a19b5f55ad1123703a9a3f0a2c649
|
4
|
+
data.tar.gz: e06d8629855c1b3c4817f73016f9fdcfe3733c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a0538609ef8c9f50139ec4910f67c3c33cfb4d311f526907315a0a7447e4aad8850e1ead94b3006a73e2c22ecb31c25eeeb2a7990081ee699ee9c398789d140
|
7
|
+
data.tar.gz: 27e157ec567e5937c5c6ec2fd188325454d59b76abc4a3ff8666232df4890e69883d36fbba99c610a78d3bee6550e17d6c8fd0180fffcad52794a8a484ce9822
|
data/README.md
CHANGED
@@ -861,8 +861,13 @@ function parses the selector string (for example, `.block__element__element`) li
|
|
861
861
|
// @return [list] : parsed list of selectors according to syntax
|
862
862
|
|
863
863
|
@function support-syntax-bem($selectors) {
|
864
|
-
|
864
|
+
// Clean up selector, remove double underscores for spaces
|
865
|
+
$selectors: replace-substring($selectors, "__");
|
866
|
+
// Parse string to list
|
867
|
+
$selectors: string-to-list($selectors);
|
868
|
+
// Define top-most parent of selector
|
865
869
|
$parent: nth($selectors, 1);
|
870
|
+
// Create new list of parsed selectors
|
866
871
|
$selector-list: ($parent);
|
867
872
|
|
868
873
|
// Loop over each selector and build list of selectors
|
data/lib/flint.rb
CHANGED
@@ -5,7 +5,7 @@ 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.
|
8
|
+
VERSION = "1.6.4"
|
9
9
|
DATE = "2014-07-08"
|
10
10
|
end
|
11
11
|
|
@@ -3,31 +3,23 @@
|
|
3
3
|
// @param $string [string] : string that contains substring
|
4
4
|
// @param $substring [string] : substring to replace
|
5
5
|
// @param $new-substring [string] : new string to replace sub with
|
6
|
-
// @param $recursive [bool] : recursively replace all substrings
|
7
6
|
// -------------------------------------------------------------------------------
|
8
7
|
// @return [string]
|
9
8
|
|
10
|
-
@function replace-substring($string, $substring, $new-substring: " "
|
9
|
+
@function replace-substring($string, $substring, $new-substring: " ") {
|
11
10
|
// Loop through length of string
|
12
11
|
@for $i from 1 through str-length($string) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
$sub-length: str-length($substring);
|
12
|
+
// Get index and length of substring
|
13
|
+
$sub-index: str-index($string, $substring);
|
14
|
+
$sub-length: str-length($substring);
|
17
15
|
|
18
16
|
// If count is index of substring
|
19
17
|
@if $i == $sub-index {
|
20
|
-
|
21
18
|
// Slice string to exclude substring
|
22
19
|
$string-before: str-slice($string, 1, $i - 1);
|
23
20
|
$string-after: str-slice($string, $i + $sub-length, str-length($string));
|
24
|
-
|
25
21
|
// Create new string
|
26
22
|
$string: $string-before + $new-substring + $string-after;
|
27
|
-
|
28
|
-
@if $recursive {
|
29
|
-
$string: replace-substring($string, $substring, $new-substring);
|
30
|
-
}
|
31
23
|
}
|
32
24
|
|
33
25
|
}
|