less 0.8.11 → 0.8.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/less.gemspec +3 -2
- data/lib/less/tree.rb +2 -2
- data/spec/css/less-0.8.12.css +28 -0
- data/spec/engine_spec.rb +3 -3
- data/spec/spec.css +5 -8
- data/spec/spec.less +9 -13
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.12
|
data/less.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{less}
|
5
|
-
s.version = "0.8.
|
5
|
+
s.version = "0.8.12"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["cloudhead"]
|
9
|
-
s.date = %q{2009-06-
|
9
|
+
s.date = %q{2009-06-21}
|
10
10
|
s.default_executable = %q{lessc}
|
11
11
|
s.description = %q{LESS is leaner CSS}
|
12
12
|
s.email = %q{alexis@cloudhead.net}
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
"spec/command_spec.rb",
|
31
31
|
"spec/css/less-0.8.10.css",
|
32
32
|
"spec/css/less-0.8.11.css",
|
33
|
+
"spec/css/less-0.8.12.css",
|
33
34
|
"spec/css/less-0.8.5.css",
|
34
35
|
"spec/css/less-0.8.6.css",
|
35
36
|
"spec/css/less-0.8.7.css",
|
data/lib/less/tree.rb
CHANGED
@@ -53,9 +53,9 @@ module Less
|
|
53
53
|
self.each do |key, value| # `self` is the current node, starting with the trunk
|
54
54
|
if value.is_a? Hash and key != :variables # If the node is a branch, we can go deeper
|
55
55
|
path << key # Add the current branch to the path
|
56
|
+
yield path, self[ key ] if by == :branch # The node is a branch, yield it to the block
|
56
57
|
self[ key ] = value.to_tree. # Make sure any change is saved to the main tree
|
57
58
|
traverse by, path, &blk # Recurse, with the current node becoming `self`
|
58
|
-
yield path, self[ key ] if by == :branch # The node is a branch, yield it to the block
|
59
59
|
path.pop # We're returning from a branch, pop the last path element
|
60
60
|
elsif by == :leaf and key.is_a? String
|
61
61
|
yield key, value, path, self # The node is a leaf, yield it to the block
|
@@ -74,7 +74,7 @@ module Less
|
|
74
74
|
properties = node.inject("") do |s, (k, v)|
|
75
75
|
v.is_a?(String) ? (s + "#{k}: #{CGI.unescape(v)}; ") : s # Add the property to the list
|
76
76
|
end
|
77
|
-
css << path * ( chain == :desc ? ' ' : ' > ') + " { " + properties + "}"
|
77
|
+
css << path * ( chain == :desc ? ' ' : ' > ') + " { " + properties + "}" unless properties.empty? # Add the rule-set to the CSS
|
78
78
|
end
|
79
79
|
css.join "\n"
|
80
80
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
ul li:first-child { border-top: none; }
|
2
|
+
h5:focus { outline: 0; content: '*}#f~ '; }
|
3
|
+
.duplicate { color: blue; width: 11px; }
|
4
|
+
body, div > p a, h2 a > span:first-child { font-family: sans-serif; }
|
5
|
+
q:lang(no) { quotes: '~' '~'; }
|
6
|
+
.no-semi-column { color: orange; }
|
7
|
+
body { text-shadow: #333 -1px 1px 2px; font-size: 10px; margin: -5px 0 5px 10px; background-color: #aaa; border: solid 1px #000; font-family: 'Lucida Grande', 'Helvetica', Verdana, sans-serif; -moz-border-radius: 3px; color: #ccc; }
|
8
|
+
td, tr, table { border-width: 88px; }
|
9
|
+
div > a, a span { color: grey; }
|
10
|
+
.space { color: purple; font-color: yellow; }
|
11
|
+
blockquote:before { color: red; }
|
12
|
+
#operations { font-size: 66; colorb: #333333; colorc: #777777; color: #eeeeee; font: 12px/16px; width: 110px; }
|
13
|
+
#operations div { width: 80px; }
|
14
|
+
.root a:hover, a:focus { color: orange; }
|
15
|
+
.root a { display: none; color: blue; }
|
16
|
+
.root .first { color: green; }
|
17
|
+
.root .first .second .third { font-size: 8px; border-color: red; background-color: blue; color: red; }
|
18
|
+
.p:first-letter { color: red; }
|
19
|
+
.extra .dark-borders { border-color: #444444; }
|
20
|
+
.extra .light-borders { border-color: #888; }
|
21
|
+
a:link, a:hover { color: brown; }
|
22
|
+
ul li:first-child, ul li:last-child { background-color: #333; }
|
23
|
+
div { color: purple; }
|
24
|
+
input[type='text'] { background-color: blue; }
|
25
|
+
.root:hover a { display: block; }
|
26
|
+
.theme { background-color: #aaa; color: #ccc; }
|
27
|
+
blockquote:before, blockquote:after, q:before, q:after { content: ''; }
|
28
|
+
.transparent_box { opacity: 0.6; background-color: #FFF; filter: alpha(opacity=60); }
|
data/spec/engine_spec.rb
CHANGED
@@ -10,8 +10,8 @@ describe Less::Engine do
|
|
10
10
|
include LessEngineSpecHelper
|
11
11
|
|
12
12
|
describe "to_css" do
|
13
|
-
it "should return
|
14
|
-
lessify('p {}').should == '
|
13
|
+
it "should return an empty string for p {}" do
|
14
|
+
lessify('p {}').should == ''
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return css with variable usage" do
|
@@ -19,7 +19,7 @@ describe Less::Engine do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return css as shown on home page" do
|
22
|
-
lessify("#header { \n color: red;\n a {\n font-weight: bold;\n text-decoration: none;\n }\n}").should == "#header a { font-weight: bold; text-decoration: none; }
|
22
|
+
lessify("#header { \n color: red;\n a {\n font-weight: bold;\n text-decoration: none;\n }\n}").should == "#header { color: red; }\n#header a { font-weight: bold; text-decoration: none; }"
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should handle :hover" do
|
data/spec/spec.css
CHANGED
@@ -1,19 +1,16 @@
|
|
1
1
|
.theme { color: #ccc; background-color: #aaa; }
|
2
2
|
.extra > .dark-borders { border-color: #444444; }
|
3
3
|
.extra > .light-borders { border-color: #888; }
|
4
|
-
|
5
|
-
.borders { }
|
4
|
+
body, div > p a, h2 a > span:first-child { font-family: sans-serif; }
|
6
5
|
.root > a { color: blue; display: none; }
|
7
6
|
.root > a:hover, a:focus { color: orange; }
|
8
|
-
.root > .first > .second > .third { background-color: blue; font-size: 8px; color: red; border-color: blue; }
|
9
|
-
.root > .first > .second { }
|
10
7
|
.root > .first { color: green; }
|
11
|
-
.root { }
|
8
|
+
.root > .first > .second > .third { background-color: blue; font-size: 8px; color: red; border-color: red; }
|
12
9
|
.root:hover a { display: block; }
|
13
|
-
body { font-size: 10px; font-family: 'Lucida Grande', 'Helvetica', Verdana, sans-serif; margin: -5px 0 5px 10px; border: solid 1px #000; text-shadow: #333 -1px 1px 2px; -moz-border-radius: 3px; color: #ccc; background-color: #aaa;
|
10
|
+
body { font-size: 10px; font-family: 'Lucida Grande', 'Helvetica', Verdana, sans-serif; margin: -5px 0 5px 10px; border: solid 1px #000; text-shadow: #333 -1px 1px 2px; -moz-border-radius: 3px; color: #ccc; background-color: #aaa; }
|
11
|
+
.operations { font: 12px/16px; width: 110px; font-size: 66; color: #eeeeee; colorb: #333333; colorc: #777777; }
|
14
12
|
.operations > div { width: 80px; }
|
15
|
-
|
16
|
-
td, tr, table { border-width: 4px; }
|
13
|
+
td, tr, table { border-width: 88px; }
|
17
14
|
blockquote:before, blockquote:after, q:before, q:after { content: ''; }
|
18
15
|
a:link, a:hover { color: brown; }
|
19
16
|
div > a, a span { color: grey; }
|
data/spec/spec.less
CHANGED
@@ -16,17 +16,16 @@
|
|
16
16
|
.extra {
|
17
17
|
@main: #888;
|
18
18
|
.dark-borders {
|
19
|
-
border-color:
|
19
|
+
border-color: @main / 2;
|
20
20
|
}
|
21
21
|
.light-borders {
|
22
|
-
border-color:
|
22
|
+
border-color: @main;
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
-
//
|
27
|
-
|
28
|
-
|
29
|
-
@thin: 2px;
|
26
|
+
// Complex Selectors
|
27
|
+
body, div > p a, h2 a > span:first-child {
|
28
|
+
font-family: sans-serif;
|
30
29
|
}
|
31
30
|
|
32
31
|
// Hierarchy
|
@@ -49,7 +48,7 @@
|
|
49
48
|
background-color: @color; // blue
|
50
49
|
font-size: @size; // 8px
|
51
50
|
color: @main-color; // red
|
52
|
-
border-color:
|
51
|
+
border-color: @main-color; // 'red'
|
53
52
|
}
|
54
53
|
}
|
55
54
|
}
|
@@ -67,11 +66,10 @@ body {
|
|
67
66
|
text-shadow: #333 -1px 1px 2px;
|
68
67
|
-moz-border-radius: 3px; /* CSS3 for older Firefox */
|
69
68
|
.theme;
|
70
|
-
.extra > .light-borders;
|
71
69
|
}
|
72
70
|
|
73
71
|
// Operations
|
74
|
-
|
72
|
+
#operations {
|
75
73
|
@ten: 10;
|
76
74
|
@dark: #111;
|
77
75
|
@box: 100px;
|
@@ -79,16 +77,14 @@ body {
|
|
79
77
|
font: 12px/16px; // 12px/16px
|
80
78
|
width: @box + @border_width; // 110px
|
81
79
|
div { width: @box - 2 * @border_width; } // 80px
|
82
|
-
border-width: .borders > @thick * 5 - 4px; // 16px
|
83
80
|
font-size: 10 - 4 + 6 * @ten; // 66
|
84
|
-
line-height: @ten - .operations > @ten + .root > .first > @size - 1; // 7px
|
85
81
|
color: #fff - #111; // #eeeeee
|
86
82
|
colorb: #111 + #222222; // #333333
|
87
83
|
colorc: @dark + #222 * 3; // #777777
|
88
84
|
}
|
89
85
|
|
90
86
|
td, tr, table {
|
91
|
-
border-width:
|
87
|
+
border-width: 88px;
|
92
88
|
}
|
93
89
|
|
94
90
|
// More complex CSS selectors
|
@@ -109,7 +105,7 @@ ul li:first-child, ul li:last-child {
|
|
109
105
|
.p:first-letter {
|
110
106
|
color: red;
|
111
107
|
}
|
112
|
-
:focus {
|
108
|
+
h5:focus {
|
113
109
|
outline: 0;
|
114
110
|
content: "*}#f~ ";
|
115
111
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: less
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cloudhead
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-21 00:00:00 -04:00
|
13
13
|
default_executable: lessc
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- spec/command_spec.rb
|
38
38
|
- spec/css/less-0.8.10.css
|
39
39
|
- spec/css/less-0.8.11.css
|
40
|
+
- spec/css/less-0.8.12.css
|
40
41
|
- spec/css/less-0.8.5.css
|
41
42
|
- spec/css/less-0.8.6.css
|
42
43
|
- spec/css/less-0.8.7.css
|