less 1.0.11 → 1.0.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 +39 -32
- data/lib/less/engine/less.tt +25 -23
- data/lib/less/engine/nodes/element.rb +47 -11
- data/lib/less/engine/nodes/property.rb +26 -6
- data/lib/less/engine/nodes/ruleset.rb +12 -0
- data/lib/less/engine/nodes.rb +1 -0
- data/lib/less/engine/parser.rb +3 -2
- data/lib/less/engine.rb +2 -2
- data/spec/css/{accessors-1.0.css → accessors.css} +0 -0
- data/spec/css/{big-1.0.css → big.css} +0 -0
- data/spec/css/{colors-1.0.css → colors.css} +0 -0
- data/spec/css/{comments-1.0.css → comments.css} +0 -0
- data/spec/css/css-3.css +2 -0
- data/spec/css/{css-1.0.css → css.css} +0 -0
- data/spec/css/{functions-1.0.css → functions.css} +0 -0
- data/spec/css/{import-1.0.css → import.css} +0 -0
- data/spec/css/lazy-eval.css +1 -0
- data/spec/css/mixins-args.css +0 -0
- data/spec/css/{mixins-1.0.css → mixins.css} +0 -0
- data/spec/css/{operations-1.0.css → operations.css} +0 -0
- data/spec/css/{rulesets-1.0.css → rulesets.css} +0 -0
- data/spec/css/{scope-1.0.css → scope.css} +1 -4
- data/spec/css/selectors.css +8 -0
- data/spec/css/{strings-1.0.css → strings.css} +0 -0
- data/spec/css/{variables-1.0.css → variables.css} +0 -0
- data/spec/css/{whitespace-1.0.css → whitespace.css} +1 -4
- data/spec/engine_spec.rb +15 -3
- data/spec/less/{accessors-1.0.less → accessors.less} +0 -0
- data/spec/less/{big-1.0.less → big.less} +0 -0
- data/spec/less/{colors-1.0.less → colors.less} +0 -0
- data/spec/less/{comments-1.0.less → comments.less} +0 -0
- data/spec/less/{css3-1.0.less → css-3.less} +0 -0
- data/spec/less/{css-1.0.less → css.less} +0 -0
- data/spec/less/{functions-1.0.less → functions.less} +0 -0
- data/spec/less/{import-1.0.less → import.less} +0 -0
- data/spec/less/lazy-eval.less +6 -0
- data/spec/less/mixins-args.less +0 -0
- data/spec/less/{mixins-1.0.less → mixins.less} +0 -0
- data/spec/less/{operations-1.0.less → operations.less} +0 -0
- data/spec/less/{rulesets-1.0.less → rulesets.less} +0 -0
- data/spec/less/{scope-1.0.less → scope.less} +1 -2
- data/spec/less/selectors.less +15 -0
- data/spec/less/{strings-1.0.less → strings.less} +0 -0
- data/spec/less/{variables-1.0.less → variables.less} +0 -0
- data/spec/less/{whitespace-1.0.less → whitespace.less} +0 -0
- data/spec/spec.css +1 -3
- metadata +39 -32
- data/spec/css/css3-1.0.css +0 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.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 = "1.0.
|
5
|
+
s.version = "1.0.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-07-
|
9
|
+
s.date = %q{2009-07-20}
|
10
10
|
s.default_executable = %q{lessc}
|
11
11
|
s.description = %q{LESS is leaner CSS}
|
12
12
|
s.email = %q{self@cloudhead.net}
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/less/engine/nodes/function.rb",
|
35
35
|
"lib/less/engine/nodes/literal.rb",
|
36
36
|
"lib/less/engine/nodes/property.rb",
|
37
|
+
"lib/less/engine/nodes/ruleset.rb",
|
37
38
|
"lib/less/engine/nodes/selector.rb",
|
38
39
|
"lib/less/engine/parser.rb",
|
39
40
|
"lib/vendor/treetop/.gitignore",
|
@@ -127,43 +128,49 @@ Gem::Specification.new do |s|
|
|
127
128
|
"lib/vendor/treetop/spec/spec_suite.rb",
|
128
129
|
"lib/vendor/treetop/treetop.gemspec",
|
129
130
|
"spec/command_spec.rb",
|
130
|
-
"spec/css/accessors
|
131
|
-
"spec/css/big
|
132
|
-
"spec/css/colors
|
133
|
-
"spec/css/comments
|
134
|
-
"spec/css/css-
|
135
|
-
"spec/css/
|
136
|
-
"spec/css/functions
|
137
|
-
"spec/css/import
|
138
|
-
"spec/css/
|
139
|
-
"spec/css/
|
140
|
-
"spec/css/
|
141
|
-
"spec/css/
|
142
|
-
"spec/css/
|
143
|
-
"spec/css/
|
144
|
-
"spec/css/
|
131
|
+
"spec/css/accessors.css",
|
132
|
+
"spec/css/big.css",
|
133
|
+
"spec/css/colors.css",
|
134
|
+
"spec/css/comments.css",
|
135
|
+
"spec/css/css-3.css",
|
136
|
+
"spec/css/css.css",
|
137
|
+
"spec/css/functions.css",
|
138
|
+
"spec/css/import.css",
|
139
|
+
"spec/css/lazy-eval.css",
|
140
|
+
"spec/css/mixins-args.css",
|
141
|
+
"spec/css/mixins.css",
|
142
|
+
"spec/css/operations.css",
|
143
|
+
"spec/css/rulesets.css",
|
144
|
+
"spec/css/scope.css",
|
145
|
+
"spec/css/selectors.css",
|
146
|
+
"spec/css/strings.css",
|
147
|
+
"spec/css/variables.css",
|
148
|
+
"spec/css/whitespace.css",
|
145
149
|
"spec/engine_spec.rb",
|
146
|
-
"spec/less/accessors
|
147
|
-
"spec/less/big
|
148
|
-
"spec/less/colors
|
149
|
-
"spec/less/comments
|
150
|
-
"spec/less/css-
|
151
|
-
"spec/less/
|
150
|
+
"spec/less/accessors.less",
|
151
|
+
"spec/less/big.less",
|
152
|
+
"spec/less/colors.less",
|
153
|
+
"spec/less/comments.less",
|
154
|
+
"spec/less/css-3.less",
|
155
|
+
"spec/less/css.less",
|
152
156
|
"spec/less/exceptions/mixed-units-error.less",
|
153
157
|
"spec/less/exceptions/name-error-1.0.less",
|
154
158
|
"spec/less/exceptions/syntax-error-1.0.less",
|
155
|
-
"spec/less/functions
|
156
|
-
"spec/less/import
|
159
|
+
"spec/less/functions.less",
|
160
|
+
"spec/less/import.less",
|
157
161
|
"spec/less/import/import-test-a.less",
|
158
162
|
"spec/less/import/import-test-b.less",
|
159
163
|
"spec/less/import/import-test-c.less",
|
160
|
-
"spec/less/
|
161
|
-
"spec/less/
|
162
|
-
"spec/less/
|
163
|
-
"spec/less/
|
164
|
-
"spec/less/
|
165
|
-
"spec/less/
|
166
|
-
"spec/less/
|
164
|
+
"spec/less/lazy-eval.less",
|
165
|
+
"spec/less/mixins-args.less",
|
166
|
+
"spec/less/mixins.less",
|
167
|
+
"spec/less/operations.less",
|
168
|
+
"spec/less/rulesets.less",
|
169
|
+
"spec/less/scope.less",
|
170
|
+
"spec/less/selectors.less",
|
171
|
+
"spec/less/strings.less",
|
172
|
+
"spec/less/variables.less",
|
173
|
+
"spec/less/whitespace.less",
|
167
174
|
"spec/spec.css",
|
168
175
|
"spec/spec.less",
|
169
176
|
"spec/spec_helper.rb"
|
data/lib/less/engine/less.tt
CHANGED
@@ -14,13 +14,13 @@ grammar Less
|
|
14
14
|
selectors "{" ws primary ws "}" ws {
|
15
15
|
def build env
|
16
16
|
# Build the ruleset for each selector
|
17
|
-
selectors.build(env, :
|
17
|
+
selectors.build(env, :ruleset).each do |sel|
|
18
18
|
primary.build sel
|
19
19
|
end
|
20
20
|
end
|
21
21
|
} / ws selectors ';' ws {
|
22
22
|
def build env
|
23
|
-
selectors.build(env, :
|
23
|
+
selectors.build(env, :mixin).each do |path|
|
24
24
|
rules = path.inject(env.root) do |current, node|
|
25
25
|
current.descend(node.selector, node) or raise MixinNameError, path.join
|
26
26
|
end.rules
|
@@ -79,15 +79,15 @@ grammar Less
|
|
79
79
|
# div > p a {...}
|
80
80
|
#
|
81
81
|
rule selector
|
82
|
-
(s select element s)+ {
|
83
|
-
def
|
82
|
+
(s select element s)+ arguments? {
|
83
|
+
def ruleset env
|
84
84
|
elements.inject(env) do |node, e|
|
85
85
|
node << Node::Element.new(e.element.text_value, e.select.text_value)
|
86
86
|
node.last
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
90
|
+
def mixin env
|
91
91
|
elements.map do |e|
|
92
92
|
Node::Element.new(e.element.text_value, e.select.text_value)
|
93
93
|
end
|
@@ -102,7 +102,7 @@ grammar Less
|
|
102
102
|
rule declaration
|
103
103
|
ws name:(ident / variable) s ':' s expression s (';'/ ws &'}') ws {
|
104
104
|
def build env
|
105
|
-
env << (name.text_value =~ /^@/ ? Node::Variable : Node::Property).new(name.text_value)
|
105
|
+
env << (name.text_value =~ /^@/ ? Node::Variable : Node::Property).new(name.text_value, [])
|
106
106
|
expression.build env
|
107
107
|
end
|
108
108
|
# Empty rule
|
@@ -156,7 +156,7 @@ grammar Less
|
|
156
156
|
rule variable
|
157
157
|
'@' [-a-zA-Z0-9_]+ {
|
158
158
|
def build env
|
159
|
-
env.identifiers.last <<
|
159
|
+
env.identifiers.last << Node::Variable.new(text_value)
|
160
160
|
end
|
161
161
|
}
|
162
162
|
end
|
@@ -294,10 +294,9 @@ grammar Less
|
|
294
294
|
def build env
|
295
295
|
env.identifiers.last << Node::Color.new(*rgb.build)
|
296
296
|
end
|
297
|
-
} / fn:(('hsl'/'rgb') 'a'?)
|
297
|
+
} / fn:(('hsl'/'rgb') 'a'?) arguments {
|
298
298
|
def build env
|
299
|
-
|
300
|
-
env.identifiers.last << Node::Function.new(fn.text_value, args.flatten)
|
299
|
+
env.identifiers.last << Node::Function.new(fn.text_value, arguments.build.flatten)
|
301
300
|
end
|
302
301
|
}
|
303
302
|
end
|
@@ -325,43 +324,46 @@ grammar Less
|
|
325
324
|
# Functions and arguments
|
326
325
|
#
|
327
326
|
rule function
|
328
|
-
name:([-a-zA-Z_]+)
|
327
|
+
name:([-a-zA-Z_]+) arguments {
|
329
328
|
def build env
|
330
|
-
|
331
|
-
env.identifiers.last << Node::Function.new(name.text_value, [args].flatten)
|
329
|
+
env.identifiers.last << Node::Function.new(name.text_value, [arguments.build].flatten)
|
332
330
|
end
|
333
331
|
}
|
334
332
|
end
|
335
333
|
|
336
334
|
rule arguments
|
337
|
-
argument s ',' s
|
338
|
-
def build
|
339
|
-
|
340
|
-
e.build
|
335
|
+
'(' s argument s tail:(',' s argument s)* ')' {
|
336
|
+
def build
|
337
|
+
all.map do |e|
|
338
|
+
e.build if e.respond_to? :build
|
341
339
|
end.compact
|
342
340
|
end
|
343
|
-
|
341
|
+
|
342
|
+
def all
|
343
|
+
[argument] + tail.elements.map {|e| e.argument }
|
344
|
+
end
|
345
|
+
}
|
344
346
|
end
|
345
347
|
|
346
348
|
rule argument
|
347
349
|
color {
|
348
|
-
def build
|
350
|
+
def build
|
349
351
|
Node::Color.new text_value
|
350
352
|
end
|
351
353
|
} / number unit {
|
352
|
-
def build
|
354
|
+
def build
|
353
355
|
Node::Number.new number.text_value, unit.text_value
|
354
356
|
end
|
355
357
|
} / string {
|
356
|
-
def build
|
358
|
+
def build
|
357
359
|
Node::String.new text_value
|
358
360
|
end
|
359
361
|
} / [a-zA-Z]+ '=' dimension {
|
360
|
-
def build
|
362
|
+
def build
|
361
363
|
Node::Anonymous.new text_value
|
362
364
|
end
|
363
365
|
} / [-a-zA-Z0-9_%$/.&=:;#+?]+ {
|
364
|
-
def build
|
366
|
+
def build
|
365
367
|
Node::String.new text_value
|
366
368
|
end
|
367
369
|
}
|
@@ -12,12 +12,12 @@ module Less
|
|
12
12
|
include Enumerable
|
13
13
|
include Entity
|
14
14
|
|
15
|
-
attr_accessor :rules, :selector, :partial, :file
|
15
|
+
attr_accessor :rules, :selector, :partial, :file, :set
|
16
16
|
|
17
17
|
def initialize name = "", selector = ''
|
18
|
-
super name
|
19
|
-
|
20
|
-
@
|
18
|
+
super name
|
19
|
+
|
20
|
+
@set = []
|
21
21
|
@rules = [] # Holds all the nodes under this element's hierarchy
|
22
22
|
@selector = Selector[selector.strip].new # descendant | child | adjacent
|
23
23
|
end
|
@@ -32,7 +32,7 @@ module Less
|
|
32
32
|
|
33
33
|
# Top-most node?
|
34
34
|
def root?
|
35
|
-
|
35
|
+
parent.nil?
|
36
36
|
end
|
37
37
|
|
38
38
|
def empty?
|
@@ -42,6 +42,43 @@ module Less
|
|
42
42
|
def leaf?
|
43
43
|
elements.empty?
|
44
44
|
end
|
45
|
+
|
46
|
+
# Group similar rulesets together
|
47
|
+
# This is horrible, horrible code,
|
48
|
+
# but it'll have to do until I find
|
49
|
+
# a proper way to do it.
|
50
|
+
def group
|
51
|
+
matched = false
|
52
|
+
stack, result = elements.dup, []
|
53
|
+
return self unless elements.size > 1
|
54
|
+
|
55
|
+
elements.each do
|
56
|
+
e = stack.first
|
57
|
+
result << e unless matched
|
58
|
+
|
59
|
+
matched = stack[1..-1].each do |ee|
|
60
|
+
if e.rules.size == ee.rules.size and
|
61
|
+
e.elements.size == 0 and
|
62
|
+
!e.rules.zip(ee.rules).map {|a, b|
|
63
|
+
a.to_css == b.to_css
|
64
|
+
}.include?(false)
|
65
|
+
|
66
|
+
# Add to set unless it's a duplicate
|
67
|
+
if e == ee
|
68
|
+
# Do something with dups
|
69
|
+
else
|
70
|
+
self[e].set << ee
|
71
|
+
end
|
72
|
+
stack.shift
|
73
|
+
else
|
74
|
+
stack.shift
|
75
|
+
break false
|
76
|
+
end
|
77
|
+
end if stack.size > 1
|
78
|
+
end
|
79
|
+
@rules -= (elements - result)
|
80
|
+
self
|
81
|
+
end
|
45
82
|
|
46
83
|
#
|
47
84
|
# Accessors for the different nodes in @rules
|
@@ -84,7 +121,7 @@ module Less
|
|
84
121
|
|
85
122
|
def last; elements.last end
|
86
123
|
def first; elements.first end
|
87
|
-
def to_s; super end
|
124
|
+
def to_s; root?? '*' : super end
|
88
125
|
|
89
126
|
#
|
90
127
|
# Entry point for the css conversion
|
@@ -95,15 +132,15 @@ module Less
|
|
95
132
|
content = properties.map do |i|
|
96
133
|
' ' * 2 + i.to_css
|
97
134
|
end.compact.reject(&:empty?) * "\n"
|
98
|
-
|
135
|
+
|
99
136
|
content = content.include?("\n") ?
|
100
137
|
"\n#{content}\n" : " #{content.strip} "
|
101
138
|
ruleset = !content.strip.empty??
|
102
|
-
"#{path.reject(&:empty?).join.strip} {#{content}}\n" : ""
|
103
|
-
|
139
|
+
"#{[path.reject(&:empty?).join.strip, *@set] * ', '} {#{content}}\n" : ""
|
140
|
+
|
104
141
|
css = ruleset + elements.map do |i|
|
105
142
|
i.to_css(path)
|
106
|
-
end.reject(&:empty?).join
|
143
|
+
end.reject(&:empty?).join
|
107
144
|
path.pop; path.pop
|
108
145
|
css
|
109
146
|
end
|
@@ -132,7 +169,6 @@ module Less
|
|
132
169
|
end
|
133
170
|
self
|
134
171
|
end
|
135
|
-
alias :traverse :each
|
136
172
|
|
137
173
|
def inspect depth = 0
|
138
174
|
indent = lambda {|i| '. ' * i }
|
@@ -7,12 +7,13 @@ module Less
|
|
7
7
|
|
8
8
|
def initialize key, value = nil
|
9
9
|
super key
|
10
|
-
@value = Expression.new(value ? [value] : [])
|
10
|
+
@value = Expression.new(value ? [value].flatten : [])
|
11
11
|
@eval = false # Store the first evaluation in here
|
12
12
|
end
|
13
13
|
|
14
14
|
def << token
|
15
15
|
token = Node::Anonymous.new(*token) unless token.is_a? Entity or token.is_a? Operator
|
16
|
+
token.parent = self if token.respond_to? :parent
|
16
17
|
@value << token
|
17
18
|
end
|
18
19
|
|
@@ -27,9 +28,13 @@ module Less
|
|
27
28
|
super
|
28
29
|
end
|
29
30
|
|
31
|
+
def nearest node
|
32
|
+
parent.nearest node
|
33
|
+
end
|
34
|
+
|
30
35
|
# TODO: @eval and @value should be merged
|
31
36
|
def evaluate
|
32
|
-
@eval
|
37
|
+
@eval ||= value.evaluate
|
33
38
|
end
|
34
39
|
|
35
40
|
def to_css
|
@@ -37,8 +42,11 @@ module Less
|
|
37
42
|
end
|
38
43
|
end
|
39
44
|
|
40
|
-
class Variable < Property
|
41
|
-
|
45
|
+
class Variable < Property
|
46
|
+
attr_reader :declaration
|
47
|
+
|
48
|
+
def initialize key, value = nil
|
49
|
+
@declaration = value ? true : false
|
42
50
|
super key.delete('@'), value
|
43
51
|
end
|
44
52
|
|
@@ -50,16 +58,28 @@ module Less
|
|
50
58
|
"@#{super}"
|
51
59
|
end
|
52
60
|
|
61
|
+
def evaluate
|
62
|
+
if declaration
|
63
|
+
@eval ||= value.evaluate
|
64
|
+
else
|
65
|
+
@eval ||= self.parent.nearest(to_s).evaluate
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
53
69
|
def to_ruby
|
54
|
-
|
70
|
+
evaluate.to_ruby
|
55
71
|
end
|
56
72
|
|
57
73
|
def to_css
|
58
|
-
|
74
|
+
evaluate.to_css
|
59
75
|
end
|
60
76
|
end
|
61
77
|
|
62
78
|
class Expression < Array
|
79
|
+
def initialize ary
|
80
|
+
super [ary].flatten
|
81
|
+
end
|
82
|
+
|
63
83
|
def operators; select {|i| i.is_a? Operator } end
|
64
84
|
def entities; select {|i| i.kind_of? Entity } end
|
65
85
|
def literals; select {|i| i.kind_of? Literal } end
|
data/lib/less/engine/nodes.rb
CHANGED
data/lib/less/engine/parser.rb
CHANGED
@@ -1029,7 +1029,7 @@ module Less
|
|
1029
1029
|
|
1030
1030
|
module Declaration2
|
1031
1031
|
def build env
|
1032
|
-
env << (name.text_value =~ /^@/ ? Node::Variable : Node::Property).new(name.text_value)
|
1032
|
+
env << (name.text_value =~ /^@/ ? Node::Variable : Node::Property).new(name.text_value, [])
|
1033
1033
|
expression.build env
|
1034
1034
|
end
|
1035
1035
|
# Empty rule
|
@@ -1601,7 +1601,8 @@ module Less
|
|
1601
1601
|
|
1602
1602
|
module Variable1
|
1603
1603
|
def build env
|
1604
|
-
env.identifiers.last << env.nearest(text_value)
|
1604
|
+
#env.identifiers.last << env.nearest(text_value)
|
1605
|
+
env.identifiers.last << Node::Variable.new(text_value)
|
1605
1606
|
end
|
1606
1607
|
end
|
1607
1608
|
|
data/lib/less/engine.rb
CHANGED
@@ -34,13 +34,13 @@ module Less
|
|
34
34
|
else
|
35
35
|
raise SyntaxError, @parser.failure_message
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
@tree
|
39
39
|
end
|
40
40
|
alias :to_tree :parse
|
41
41
|
|
42
42
|
def to_css
|
43
|
-
@css || @css = self.parse.to_css
|
43
|
+
@css || @css = self.parse.group.to_css
|
44
44
|
end
|
45
45
|
|
46
46
|
def prepare
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/css/css-3.css
ADDED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
.lazy-eval { width: 100%; }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,11 +1,8 @@
|
|
1
|
+
.whitespace, .white, .space, .mania, .no-semi-column { color: white; }
|
1
2
|
.whitespace { color: white; }
|
2
3
|
.whitespace { color: white; }
|
3
4
|
.whitespace { color: white; }
|
4
5
|
.whitespace { color: white; }
|
5
|
-
.whitespace { color: white; }
|
6
|
-
.white { color: white; }
|
7
|
-
.space { color: white; }
|
8
|
-
.mania { color: white; }
|
9
6
|
.no-semi-column { color: white; }
|
10
7
|
.no-semi-column {
|
11
8
|
color: white;
|
data/spec/engine_spec.rb
CHANGED
@@ -5,12 +5,12 @@ module LessEngineSpecHelper
|
|
5
5
|
if arg.is_a? String or arg.is_a? File
|
6
6
|
return Less::Engine.new(arg).to_css
|
7
7
|
else
|
8
|
-
lessify File.new("spec/less/#{arg}
|
8
|
+
lessify File.new("spec/less/#{arg.to_s.gsub('_', '-')}.less")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def css file
|
13
|
-
File.read("spec/css/#{file}
|
13
|
+
File.read("spec/css/#{file.to_s.gsub('_', '-')}.css")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -22,8 +22,12 @@ describe Less::Engine do
|
|
22
22
|
lessify(:css).should == css(:css)
|
23
23
|
end
|
24
24
|
|
25
|
+
it "should group selectors when it can" do
|
26
|
+
lessify(:selectors).should == css(:selectors)
|
27
|
+
end
|
28
|
+
|
25
29
|
it "should parse css 3" do
|
26
|
-
lessify(:
|
30
|
+
lessify(:css_3).should == css(:css_3)
|
27
31
|
end
|
28
32
|
|
29
33
|
it "should parse comments" do
|
@@ -65,6 +69,14 @@ describe Less::Engine do
|
|
65
69
|
it "should parse mixins" do
|
66
70
|
lessify(:mixins).should == css(:mixins)
|
67
71
|
end
|
72
|
+
|
73
|
+
it "should parse mixins with arguments" do
|
74
|
+
lessify(:mixins_args).should == css(:mixins_args)
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should evaluate variables lazily" do
|
78
|
+
lessify(:lazy_eval).should == css(:lazy_eval)
|
79
|
+
end
|
68
80
|
|
69
81
|
it "should handle custom functions" do
|
70
82
|
module Less::Functions
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec.css
CHANGED
@@ -40,9 +40,7 @@ body {
|
|
40
40
|
colorc: #777777;
|
41
41
|
}
|
42
42
|
#operations div { width: 80px; }
|
43
|
-
td { border-width: 88px; }
|
44
|
-
tr { border-width: 88px; }
|
45
|
-
table { border-width: 88px; }
|
43
|
+
td, tr, table { border-width: 88px; }
|
46
44
|
blockquote:before { content: ""; }
|
47
45
|
blockquote:after { content: ""; }
|
48
46
|
q:before { content: ""; }
|
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: 1.0.
|
4
|
+
version: 1.0.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-07-
|
12
|
+
date: 2009-07-20 00:00:00 -04:00
|
13
13
|
default_executable: lessc
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- lib/less/engine/nodes/function.rb
|
42
42
|
- lib/less/engine/nodes/literal.rb
|
43
43
|
- lib/less/engine/nodes/property.rb
|
44
|
+
- lib/less/engine/nodes/ruleset.rb
|
44
45
|
- lib/less/engine/nodes/selector.rb
|
45
46
|
- lib/less/engine/parser.rb
|
46
47
|
- lib/vendor/treetop/.gitignore
|
@@ -134,43 +135,49 @@ files:
|
|
134
135
|
- lib/vendor/treetop/spec/spec_suite.rb
|
135
136
|
- lib/vendor/treetop/treetop.gemspec
|
136
137
|
- spec/command_spec.rb
|
137
|
-
- spec/css/accessors
|
138
|
-
- spec/css/big
|
139
|
-
- spec/css/colors
|
140
|
-
- spec/css/comments
|
141
|
-
- spec/css/css-
|
142
|
-
- spec/css/
|
143
|
-
- spec/css/functions
|
144
|
-
- spec/css/import
|
145
|
-
- spec/css/
|
146
|
-
- spec/css/
|
147
|
-
- spec/css/
|
148
|
-
- spec/css/
|
149
|
-
- spec/css/
|
150
|
-
- spec/css/
|
151
|
-
- spec/css/
|
138
|
+
- spec/css/accessors.css
|
139
|
+
- spec/css/big.css
|
140
|
+
- spec/css/colors.css
|
141
|
+
- spec/css/comments.css
|
142
|
+
- spec/css/css-3.css
|
143
|
+
- spec/css/css.css
|
144
|
+
- spec/css/functions.css
|
145
|
+
- spec/css/import.css
|
146
|
+
- spec/css/lazy-eval.css
|
147
|
+
- spec/css/mixins-args.css
|
148
|
+
- spec/css/mixins.css
|
149
|
+
- spec/css/operations.css
|
150
|
+
- spec/css/rulesets.css
|
151
|
+
- spec/css/scope.css
|
152
|
+
- spec/css/selectors.css
|
153
|
+
- spec/css/strings.css
|
154
|
+
- spec/css/variables.css
|
155
|
+
- spec/css/whitespace.css
|
152
156
|
- spec/engine_spec.rb
|
153
|
-
- spec/less/accessors
|
154
|
-
- spec/less/big
|
155
|
-
- spec/less/colors
|
156
|
-
- spec/less/comments
|
157
|
-
- spec/less/css-
|
158
|
-
- spec/less/
|
157
|
+
- spec/less/accessors.less
|
158
|
+
- spec/less/big.less
|
159
|
+
- spec/less/colors.less
|
160
|
+
- spec/less/comments.less
|
161
|
+
- spec/less/css-3.less
|
162
|
+
- spec/less/css.less
|
159
163
|
- spec/less/exceptions/mixed-units-error.less
|
160
164
|
- spec/less/exceptions/name-error-1.0.less
|
161
165
|
- spec/less/exceptions/syntax-error-1.0.less
|
162
|
-
- spec/less/functions
|
163
|
-
- spec/less/import
|
166
|
+
- spec/less/functions.less
|
167
|
+
- spec/less/import.less
|
164
168
|
- spec/less/import/import-test-a.less
|
165
169
|
- spec/less/import/import-test-b.less
|
166
170
|
- spec/less/import/import-test-c.less
|
167
|
-
- spec/less/
|
168
|
-
- spec/less/
|
169
|
-
- spec/less/
|
170
|
-
- spec/less/
|
171
|
-
- spec/less/
|
172
|
-
- spec/less/
|
173
|
-
- spec/less/
|
171
|
+
- spec/less/lazy-eval.less
|
172
|
+
- spec/less/mixins-args.less
|
173
|
+
- spec/less/mixins.less
|
174
|
+
- spec/less/operations.less
|
175
|
+
- spec/less/rulesets.less
|
176
|
+
- spec/less/scope.less
|
177
|
+
- spec/less/selectors.less
|
178
|
+
- spec/less/strings.less
|
179
|
+
- spec/less/variables.less
|
180
|
+
- spec/less/whitespace.less
|
174
181
|
- spec/spec.css
|
175
182
|
- spec/spec.less
|
176
183
|
- spec/spec_helper.rb
|
data/spec/css/css3-1.0.css
DELETED