SassyLists 0.2.3 → 0.2.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.
- data/CHANGELOG.md +1 -0
- data/lib/SassyLists.rb +2 -2
- data/stylesheets/SassyLists/_debug.scss +47 -43
- metadata +2 -2
data/CHANGELOG.md
CHANGED
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.2.
|
9
|
-
DATE = "2013-
|
8
|
+
VERSION = "0.2.4"
|
9
|
+
DATE = "2013-11-01"
|
10
10
|
end
|
11
11
|
|
12
12
|
module Sass::Script::Functions
|
@@ -6,63 +6,67 @@
|
|
6
6
|
// @example debug(a b (c d e)) => [ a, b, [ c, d, e ] ]
|
7
7
|
// -------------------------------------------------------------------------------
|
8
8
|
// @param $list [List] : list
|
9
|
-
// @param $
|
10
|
-
// @param $
|
9
|
+
// @param $pre [Boolean] : enable/disable variables type and proper indentation
|
10
|
+
// @param $level [Number] : internal variable for recursivity
|
11
11
|
// -------------------------------------------------------------------------------
|
12
12
|
// @return [String]
|
13
13
|
|
14
|
-
@function debug($list, $
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
$result : if($type, unquote("(list:#{length($list)})[ \A "), unquote("[ \A "));
|
20
|
-
$space : if($root, "", " ");
|
14
|
+
@function debug($list, $pre: false, $level: 1) {
|
15
|
+
@debug $level;
|
16
|
+
$tab : " ";
|
17
|
+
$indent : "";
|
18
|
+
$break : if($pre, "\A ", "");
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
@if length($item) > 1 {
|
26
|
-
$result : unquote("#{$result}#{debug($item, $type, false)}");
|
20
|
+
@for $i from 1 to $level {
|
21
|
+
$indent : $indent + $tab;
|
27
22
|
}
|
28
23
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
24
|
+
$result: "[" + $break;
|
25
|
+
|
26
|
+
@each $item in $list {
|
27
|
+
$result: $result + if($pre, $indent + $tab, " ");
|
28
|
+
|
29
|
+
@if length($item) > 1 {
|
30
|
+
$result: $result
|
31
|
+
+ if($pre, "(list: " + length($item) + ") ", "")
|
32
|
+
+ debug($item, $pre, $level + 1);
|
33
|
+
}
|
34
|
+
|
35
|
+
@else {
|
36
|
+
$result: $result
|
37
|
+
+ if($pre, "(" + type-of($item) + ") ", "")
|
38
|
+
+ $item;
|
39
|
+
}
|
35
40
|
|
36
|
-
|
37
|
-
|
41
|
+
@if index($list, $item) != length($list) {
|
42
|
+
$result: $result + "," + $break;
|
43
|
+
}
|
38
44
|
}
|
39
45
|
|
40
|
-
|
46
|
+
$result: $result + $break + if($pre, if($level > 1, $indent, ""), " ") + "]";
|
41
47
|
|
42
|
-
|
43
|
-
@return quote($result);
|
48
|
+
@return quote($result);
|
44
49
|
}
|
45
50
|
|
46
51
|
// Mixin displaying clean debug
|
47
52
|
// -------------------------------------------------------------------------------
|
48
53
|
// @param $list [List] : list
|
49
|
-
// @param $type [List] : enable/disable variables type
|
50
54
|
|
51
|
-
@mixin debug($list
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
55
|
+
@mixin debug($list) {
|
56
|
+
body:before {
|
57
|
+
content: debug($list, true) !important;
|
58
|
+
|
59
|
+
display: block !important;
|
60
|
+
margin: 1em !important;
|
61
|
+
padding: .5em !important;
|
62
|
+
|
63
|
+
background: #EFEFEF !important;
|
64
|
+
border: 1px solid #DDD !important;
|
65
|
+
border-radius: .2em !important;
|
66
|
+
|
67
|
+
color: #333 !important;
|
68
|
+
font: .75em/1.5 "Courier New", monospace !important;
|
69
|
+
text-shadow: 0 1px white !important;
|
70
|
+
white-space: pre-wrap !important;
|
71
|
+
}
|
68
72
|
}
|
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.2.
|
4
|
+
version: 0.2.4
|
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-
|
12
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|