SassyLists 0.3.2 → 0.3.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/_insert-nth.scss +6 -4
- data/stylesheets/SassyLists/_prepend.scss +7 -1
- data/stylesheets/SassyLists/_replace-nth.scss +5 -3
- data/stylesheets/SassyLists/_slice.scss +4 -4
- data/stylesheets/SassyLists/_sort.scss +4 -4
- data/stylesheets/SassyLists/_sum.scss +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
* `0.3.3`: removed dependence to `purge()` from all functions; fixed an issue with `sort()`; fixed an issue with error messages
|
3
4
|
* `0.3.2`: removed dependence to `purge()` from `replace()`
|
4
5
|
* `0.3.1`: added aliases and cleaned `to-string()`
|
5
6
|
* `0.3.0`: adding `contains()`, `flatten()`, `union()`
|
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.3.
|
9
|
-
DATE = "2013-11-
|
8
|
+
VERSION = "0.3.3"
|
9
|
+
DATE = "2013-11-06"
|
10
10
|
end
|
11
11
|
|
12
12
|
module Sass::Script::Functions
|
@@ -23,17 +23,17 @@
|
|
23
23
|
$result: false;
|
24
24
|
|
25
25
|
@if type-of($index) != number {
|
26
|
-
@warn "List index #{
|
26
|
+
@warn "List index #{$index} is not a number for `insert-nth`.";
|
27
27
|
@return $result;
|
28
28
|
}
|
29
29
|
|
30
30
|
@else if $index < 1 {
|
31
|
-
@warn "List index #{
|
31
|
+
@warn "List index #{$index} must be a non-zero integer for `insert-nth`";
|
32
32
|
@return $result;
|
33
33
|
}
|
34
34
|
|
35
35
|
@else if $index > length($list) {
|
36
|
-
@warn "List index is #{
|
36
|
+
@warn "List index is #{$index} but list is only #{length($list)} items long for `insert-nth'.";
|
37
37
|
@return $result;
|
38
38
|
}
|
39
39
|
|
@@ -42,7 +42,9 @@
|
|
42
42
|
|
43
43
|
@for $i from 1 through length($list) {
|
44
44
|
@if $i == $index {
|
45
|
-
|
45
|
+
@if $value != null and $value != "" {
|
46
|
+
$result: append($result, $value);
|
47
|
+
}
|
46
48
|
}
|
47
49
|
|
48
50
|
$result: append($result, nth($list, $i));
|
@@ -24,7 +24,7 @@
|
|
24
24
|
$result: false;
|
25
25
|
|
26
26
|
@if type-of($index) != number {
|
27
|
-
@warn "List index #{
|
27
|
+
@warn "List index #{$index} is not a number for `replace-nth`/`remove-nth`.";
|
28
28
|
@return $result;
|
29
29
|
}
|
30
30
|
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
@else if abs($index) > length($list) {
|
37
|
-
@warn "List index is #{
|
37
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `replace-nth`/`remove-nth`.";
|
38
38
|
@return $result;
|
39
39
|
}
|
40
40
|
|
@@ -43,7 +43,9 @@
|
|
43
43
|
$index: if($index < 0, length($list) + $index + 1, $index);
|
44
44
|
|
45
45
|
@for $i from 1 through length($list) {
|
46
|
-
|
46
|
+
@if $value != null and $value != "" {
|
47
|
+
$result: append($result, if($i == $index, $value, nth($list, $i)));
|
48
|
+
}
|
47
49
|
}
|
48
50
|
}
|
49
51
|
|
@@ -25,12 +25,12 @@
|
|
25
25
|
$result: false;
|
26
26
|
|
27
27
|
@if type-of($start) != number or type-of($end) != number {
|
28
|
-
@warn "List indexes #{
|
28
|
+
@warn "List indexes #{$start} and #{$end} must be numbers for `slice`.";
|
29
29
|
@return $result;
|
30
30
|
}
|
31
31
|
|
32
32
|
@else if $start > $end {
|
33
|
-
@warn "Start index is #{
|
33
|
+
@warn "Start index is #{$start} but has to be lesser than or equals to the end index (#{$end}) for `slice`.";
|
34
34
|
@return $result;
|
35
35
|
}
|
36
36
|
|
@@ -40,12 +40,12 @@
|
|
40
40
|
}
|
41
41
|
|
42
42
|
@else if $start > length($list) {
|
43
|
-
@warn "Start index is #{
|
43
|
+
@warn "Start index is #{$start} but list is only #{length($list)} items long for `slice`.";
|
44
44
|
@return $result;
|
45
45
|
}
|
46
46
|
|
47
47
|
@else if $end > length($list) {
|
48
|
-
@warn "End index is #{
|
48
|
+
@warn "End index is #{$end} but list is only #{length($list)} items long for `slice`.";
|
49
49
|
@return $result;
|
50
50
|
}
|
51
51
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
// -------------------------------------------------------------------------------
|
17
17
|
// @return [List]
|
18
18
|
|
19
|
-
@function sort($list
|
19
|
+
@function sort($list) {
|
20
20
|
$result : nth($list, 1);
|
21
21
|
|
22
22
|
@if length($list) > 1 {
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
@if type-of($item) == number {
|
28
28
|
|
29
|
-
@if unitless($item)
|
29
|
+
@if unitless($item) {
|
30
30
|
|
31
31
|
@if $item > last($result) {
|
32
32
|
$result: append($result, $item);
|
@@ -64,6 +64,6 @@
|
|
64
64
|
}
|
65
65
|
|
66
66
|
// Alias
|
67
|
-
@function order($list
|
68
|
-
@return sort($list
|
67
|
+
@function order($list) {
|
68
|
+
@return sort($list);
|
69
69
|
}
|
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.3.
|
4
|
+
version: 0.3.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-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|