less 0.8.8 → 0.8.9
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/VERSION +1 -1
- data/less.gemspec +1 -1
- data/lib/less/engine.rb +8 -2
- data/spec/css/less-0.8.8.css +1 -1
- data/spec/spec.css +1 -1
- data/spec/spec.less +1 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.9
|
data/less.gemspec
CHANGED
data/lib/less/engine.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Less
|
2
2
|
class Engine < String
|
3
3
|
# Compound properties, such as `border: 1px solid black`
|
4
|
-
COMPOUND =
|
4
|
+
COMPOUND = {'font' => true, 'background' => false, 'border' => false }
|
5
5
|
REGEX = {
|
6
6
|
:path => /([#.][->#.\w ]+)?( ?> ?)?/, # #header > .title
|
7
7
|
:selector => /[-\w #.,>*:\(\)]/, # .cow .milk > a
|
@@ -69,7 +69,13 @@ module Less
|
|
69
69
|
# Units are: 1px, 1em, 1%, #111
|
70
70
|
@tree = @tree.traverse :leaf do |key, value, path, node|
|
71
71
|
node[ key ] = value.gsub /(#{REGEX[:operand]}(\s?)[-+\/*](\4))+(#{REGEX[:operand]})/ do |operation|
|
72
|
-
|
72
|
+
# Disallow operations certain compound declarations
|
73
|
+
if COMPOUND[key]
|
74
|
+
next value
|
75
|
+
else
|
76
|
+
raise CompoundOperationError, "#{key}: #{value}"
|
77
|
+
end if COMPOUND.include? key
|
78
|
+
|
73
79
|
if (unit = operation.scan(/#{REGEX[:numeric]}|(#)/i).flatten.compact.uniq).size <= 1
|
74
80
|
unit = unit.join
|
75
81
|
operation = if unit == '#'
|
data/spec/css/less-0.8.8.css
CHANGED
@@ -19,7 +19,7 @@ ul li:first-child, ul li:last-child { background-color: #333; }
|
|
19
19
|
.borders { }
|
20
20
|
.root:hover a { display: block; }
|
21
21
|
.operations div { width: 80px; }
|
22
|
-
.operations { colorb: #333333; font-size: 66; colorc: #777777; line-height: 7px; border-width: 16px; color: #eeeeee; width: 110px; }
|
22
|
+
.operations { colorb: #333333; font-size: 66; colorc: #777777; line-height: 7px; border-width: 16px; color: #eeeeee; font: 12px/16px; width: 110px; }
|
23
23
|
:focus { outline: 0; content: '*}#f~ '; }
|
24
24
|
.theme { background-color: #aaa; color: #ccc; }
|
25
25
|
.transparent_box { opacity: 0.6; background-color: #FFF; filter: alpha(opacity=60); }
|
data/spec/spec.css
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
.root:hover a { display: block; }
|
13
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; border-color: #888; }
|
14
14
|
.operations > div { width: 80px; }
|
15
|
-
.operations { width: 110px; border-width: 16px; font-size: 66; line-height: 7px; color: #eeeeee; colorb: #333333; colorc: #777777; }
|
15
|
+
.operations { font: 12px/16px; width: 110px; border-width: 16px; font-size: 66; line-height: 7px; color: #eeeeee; colorb: #333333; colorc: #777777; }
|
16
16
|
td, tr, table { border-width: 4px; }
|
17
17
|
ul li:first-child { border-top: none; }
|
18
18
|
ul li:first-child, ul li:last-child { background-color: #333; }
|
data/spec/spec.less
CHANGED