SassyLists 0.4.2 → 0.4.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.
- data/CHANGELOG.md +1 -0
- data/lib/SassyLists.rb +2 -2
- data/stylesheets/SassyLists/_count-values.scss +1 -2
- data/stylesheets/SassyLists/_insert-nth.scss +2 -4
- data/stylesheets/SassyLists/_prepend.scss +1 -1
- data/stylesheets/SassyLists/_purge.scss +1 -1
- data/stylesheets/SassyLists/_replace-nth.scss +1 -1
- data/stylesheets/SassyLists/_replace.scss +7 -7
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
* `0.4.3`: improving `insert-nth()`, `prepend()`, `replace-nth()` and `replace()` to prevevent from adding empty lists
|
3
4
|
* `0.4.2`: improving `insert-nth()` and cleaning some indentation issues
|
4
5
|
* `0.4.1`: improving `intersection()` perf
|
5
6
|
* `0.4.0`: adding `intersection()`
|
data/lib/SassyLists.rb
CHANGED
@@ -5,8 +5,8 @@ Compass::Frameworks.register('SassyLists', :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 SassyLists
|
8
|
-
VERSION = "0.4.
|
9
|
-
DATE = "2013-11-
|
8
|
+
VERSION = "0.4.3"
|
9
|
+
DATE = "2013-11-17"
|
10
10
|
end
|
11
11
|
|
12
12
|
module Sass::Script::Functions
|
@@ -5,9 +5,7 @@
|
|
5
5
|
// @example insert-nth(a b c, 2, z) => a z d c
|
6
6
|
// @example insert-nth(a b c, 0, z) => error
|
7
7
|
// @example insert-nth(a b c, -1, z) => error
|
8
|
-
// @example insert-nth(a b c, 10, z) =>
|
9
|
-
// @example insert-nth(a b c, 4, z) => a b c d
|
10
|
-
// @example insert-nth(a b c, 5, z) => error
|
8
|
+
// @example insert-nth(a b c, 10, z) => a b c z
|
11
9
|
// -------------------------------------------------------------------------------
|
12
10
|
// @param $list [List] : list
|
13
11
|
// @param $index [Number] : index to add
|
@@ -41,7 +39,7 @@
|
|
41
39
|
|
42
40
|
@for $i from 1 through length($list) {
|
43
41
|
@if $i == $index {
|
44
|
-
@if $value !=
|
42
|
+
@if $value and $value != "" and $value != () {
|
45
43
|
$result: append($result, $value);
|
46
44
|
}
|
47
45
|
}
|
@@ -41,7 +41,7 @@
|
|
41
41
|
$index: if($index < 0, length($list) + $index + 1, $index);
|
42
42
|
|
43
43
|
@for $i from 1 through length($list) {
|
44
|
-
@if $value !=
|
44
|
+
@if $value and $value != "" and $value != () {
|
45
45
|
$result: append($result, if($i == $index, $value, nth($list, $i)));
|
46
46
|
}
|
47
47
|
}
|
@@ -8,24 +8,24 @@
|
|
8
8
|
// @example replace( (a, b, c a), a, z, true ) => z, b, c z
|
9
9
|
// -------------------------------------------------------------------------------
|
10
10
|
// @param $list [List] : list
|
11
|
-
// @param $old
|
12
|
-
// @param $
|
11
|
+
// @param $old [Literal] : value to replace
|
12
|
+
// @param $value [Literal] : new value for $old-value
|
13
13
|
// @param $recursive [Boolean] : enable / disable recursivity
|
14
14
|
// -------------------------------------------------------------------------------
|
15
15
|
// @return [List]
|
16
16
|
|
17
|
-
@function replace($list, $old
|
17
|
+
@function replace($list, $old, $value, $recursive: false) {
|
18
18
|
$result: ();
|
19
19
|
|
20
20
|
@each $item in $list {
|
21
|
-
@if $item == $old
|
22
|
-
@if $
|
23
|
-
$result: append($result, $
|
21
|
+
@if $item == $old {
|
22
|
+
@if $value and $value != '' and $value != () {
|
23
|
+
$result: append($result, $value);
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
27
|
@else if length($item) > 1 and $recursive {
|
28
|
-
$result: append($result, replace($item, $old
|
28
|
+
$result: append($result, replace($item, $old, $value, $recursive));
|
29
29
|
}
|
30
30
|
|
31
31
|
@else {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SassyLists
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|