less 1.1.10 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.10
1
+ 1.1.11
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.1.10"
5
+ s.version = "1.1.11"
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-31}
9
+ s.date = %q{2009-08-01}
10
10
  s.default_executable = %q{lessc}
11
11
  s.description = %q{LESS is leaner CSS}
12
12
  s.email = %q{self@cloudhead.net}
@@ -5,7 +5,7 @@ module Less
5
5
  # Entity: Any whitespace delimited token
6
6
  #
7
7
  rule entity
8
- function / fonts / keyword / accessor / variable / literal / important
8
+ function / fonts / keyword / accessor / variable / literal
9
9
  end
10
10
 
11
11
  rule fonts
@@ -51,15 +51,6 @@ module Less
51
51
  }
52
52
  end
53
53
 
54
- # !important
55
- rule important
56
- '!important' {
57
- def build
58
- Node::Keyword.new(text_value)
59
- end
60
- }
61
- end
62
-
63
54
  #
64
55
  # `blue`, `small`, `normal` etc.
65
56
  #
@@ -41,9 +41,9 @@ module Less
41
41
  end
42
42
 
43
43
  rule import
44
- "@import" S url:(string / url) medias? s ';' ws {
44
+ ws "@import" S url:(string / url) medias? s ';' ws {
45
45
  def build env
46
- path = File.join(env.root.file, url.value)
46
+ path = File.join(env.root.file || Dir.pwd, url.value)
47
47
  path += '.less' unless path =~ /\.(le|c)ss$/
48
48
  if File.exist? path
49
49
  imported = Less::Engine.new(File.new(path)).to_tree
@@ -133,13 +133,13 @@ module Less
133
133
  [expression] + tail.elements.map {|i| [i.operator, i.expression] }.flatten.compact
134
134
  end
135
135
  # Space-delimited expressions
136
- } / expression tail:(WS expression)* {
136
+ } / expression tail:(WS expression)* i:important? {
137
137
  def build env
138
138
  all.map {|e| e.build(env) if e.respond_to? :build }.compact
139
139
  end
140
140
 
141
141
  def all
142
- [expression] + tail.elements.map {|f| f.expression }
142
+ [expression] + tail.elements.map {|f| f.expression } + [i]
143
143
  end
144
144
  # Catch-all rule
145
145
  } / [-a-zA-Z0-9_%*/.&=:,#+? \[\]()]+ {
@@ -160,6 +160,15 @@ module Less
160
160
  end
161
161
  }
162
162
  end
163
+
164
+ # !important
165
+ rule important
166
+ s '!' s 'important' {
167
+ def build env
168
+ Node::Keyword.new(text_value.strip)
169
+ end
170
+ }
171
+ end
163
172
 
164
173
  #
165
174
  # An identifier
@@ -207,7 +216,7 @@ module Less
207
216
  end
208
217
 
209
218
  rule select
210
- (s [+>~] s / s ':' / S)?
219
+ (s [+>~] s / '::' / s ':' / S)?
211
220
  end
212
221
 
213
222
  # TODO: Merge this with attribute rule
@@ -4,11 +4,12 @@ module Less
4
4
  include Entity
5
5
 
6
6
  Selectors = {
7
- :Descendant => '',
8
- :Child => '>',
9
- :Adjacent => '+',
10
- :Pseudo => ':',
11
- :Sibling => '~'
7
+ :Descendant => '',
8
+ :Child => '>',
9
+ :Adjacent => '+',
10
+ :PseudoClass => ':',
11
+ :PseudoElement => '::',
12
+ :Sibling => '~'
12
13
  }
13
14
 
14
15
  def initialize
@@ -32,7 +33,11 @@ module Less
32
33
  def to_css; " #{self} " end
33
34
  end
34
35
 
35
- class Pseudo < Selector
36
+ class PseudoClass < Selector
37
+ def to_css; self end
38
+ end
39
+
40
+ class PseudoElement < Selector
36
41
  def to_css; self end
37
42
  end
38
43
  end
data/spec/css/css-3.css CHANGED
@@ -1,2 +1,3 @@
1
1
  p:not([class*="lead"]) { color: black; }
2
2
  a[href^="http://"], a[href$="http://"] { color: black; }
3
+ p::before { color: black; }
data/spec/css/css.css CHANGED
@@ -40,7 +40,11 @@ h2[title] { font-size: 100%; }
40
40
  display: -moz-inline-stack;
41
41
  width: 0.1em;
42
42
  background-color: #009998;
43
- color: red !important;
44
43
  background-image: url(images/image.jpg);
45
44
  background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
46
45
  }
46
+ #important {
47
+ color: red !important;
48
+ width: 100% !important;
49
+ height: 20px ! important;
50
+ }
data/spec/less/css-3.less CHANGED
@@ -9,3 +9,7 @@ a[href^="http://"] {
9
9
  a[href$="http://"] {
10
10
  color: black;
11
11
  }
12
+
13
+ p::before {
14
+ color: black;
15
+ }
data/spec/less/css.less CHANGED
@@ -91,9 +91,14 @@ h2[title] {
91
91
  display: -moz-inline-stack;
92
92
  width: .1em;
93
93
  background-color: #009998;
94
- color: red !important;
95
94
  background-image: url(images/image.jpg);
96
95
  background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
97
96
  margin: ;
98
97
  }
99
98
 
99
+ #important {
100
+ color: red !important;
101
+ width: 100%!important;
102
+ height: 20px ! important;
103
+ }
104
+
@@ -1,3 +1,4 @@
1
+
1
2
  @import "import-test-d.css";
2
3
  @c: red;
3
4
 
@@ -1,5 +1,8 @@
1
+
2
+
1
3
  .whitespace
2
4
  { color: white; }
5
+
3
6
  .whitespace
4
7
  {
5
8
  color: white;
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.1.10
4
+ version: 1.1.11
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-31 00:00:00 -04:00
12
+ date: 2009-08-01 00:00:00 +02:00
13
13
  default_executable: lessc
14
14
  dependencies: []
15
15