less 1.2.11 → 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -5
- data/VERSION +1 -1
- data/bin/lessc +5 -1
- data/less.gemspec +5 -4
- data/lib/less/command.rb +4 -2
- data/lib/less/engine/grammar/less.tt +10 -4
- data/spec/css/css-3.css +3 -0
- data/spec/less/css-3.less +6 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -2,6 +2,16 @@ LESS
|
|
2
2
|
====
|
3
3
|
It's time CSS was done right – LESS is _leaner_ css.
|
4
4
|
|
5
|
+
Setup
|
6
|
+
------
|
7
|
+
to get the latest development version:
|
8
|
+
|
9
|
+
sudo gem install less -s http://gemcutter.org
|
10
|
+
|
11
|
+
to get the latest stable version:
|
12
|
+
|
13
|
+
sudo gem install less
|
14
|
+
|
5
15
|
Explained
|
6
16
|
---------
|
7
17
|
LESS allows you to write CSS the way (I think) it was meant to, that is: with *variables*, *nested rules* and *mixins*!
|
@@ -9,22 +19,21 @@ LESS allows you to write CSS the way (I think) it was meant to, that is: with *v
|
|
9
19
|
### Here's some example LESS code:
|
10
20
|
|
11
21
|
@dark: #110011;
|
12
|
-
.outline { border:
|
22
|
+
.outline (@width: 1) { border: (@width * 10px) solid black }
|
13
23
|
|
14
24
|
.article {
|
15
25
|
a { text-decoration: none }
|
16
26
|
p { color: @dark }
|
17
|
-
.outline;
|
27
|
+
.outline(3);
|
18
28
|
}
|
19
29
|
|
20
30
|
### And the CSS output it produces:
|
21
31
|
|
22
|
-
.outline { border: 1px solid black }
|
23
32
|
.article a { text-decoration: none }
|
24
33
|
.article p { color: #110011 }
|
25
|
-
.article { border:
|
34
|
+
.article { border: 30px solid black }
|
26
35
|
|
27
|
-
If you have CSS nightmares, just
|
36
|
+
If you have CSS nightmares, just
|
28
37
|
$ lessc style.less
|
29
38
|
|
30
39
|
For more information, see you at [http://lesscss.org]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.12
|
data/bin/lessc
CHANGED
@@ -20,7 +20,7 @@ options = {
|
|
20
20
|
:compress => false,
|
21
21
|
:debug => false,
|
22
22
|
:growl => false,
|
23
|
-
:color =>
|
23
|
+
:color => $stdout.tty?
|
24
24
|
}
|
25
25
|
|
26
26
|
# Get arguments
|
@@ -49,6 +49,10 @@ opts = OptionParser.new do |o|
|
|
49
49
|
o.on("--no-color", "suppress color in output") do
|
50
50
|
options[:color] = false
|
51
51
|
end
|
52
|
+
|
53
|
+
o.on('--verbose', 'show success messages when using growl') do
|
54
|
+
options[:verbose] = true
|
55
|
+
end
|
52
56
|
|
53
57
|
# Compression needs a proper algorithm
|
54
58
|
#
|
data/less.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{less}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["cloudhead"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-11-18}
|
13
13
|
s.default_executable = %q{lessc}
|
14
14
|
s.description = %q{LESS is leaner CSS}
|
15
15
|
s.email = %q{self@cloudhead.net}
|
@@ -122,3 +122,4 @@ Gem::Specification.new do |s|
|
|
122
122
|
s.add_dependency(%q<mutter>, [">= 0.3.7"])
|
123
123
|
end
|
124
124
|
end
|
125
|
+
|
data/lib/less/command.rb
CHANGED
@@ -60,8 +60,10 @@ module Less
|
|
60
60
|
File.open( @destination, "w" ) do |file|
|
61
61
|
file.write css
|
62
62
|
end
|
63
|
-
|
64
|
-
|
63
|
+
|
64
|
+
act, file = (new ? 'Created' : 'Updated'), @destination.split('/').last
|
65
|
+
print "#{o("* #{act}", :green)} #{file}\n: " if watch?
|
66
|
+
Growl.notify "#{act} #{file}", :title => 'LESS' if @options[:growl] && @options[:verbose]
|
65
67
|
rescue Errno::ENOENT => e
|
66
68
|
abort "#{e}"
|
67
69
|
rescue SyntaxError => e
|
@@ -34,7 +34,6 @@ module Less
|
|
34
34
|
def build env
|
35
35
|
env << Node::Mixin::Def.new(name.text_value, parameters.build(env))
|
36
36
|
primary.build env.last
|
37
|
-
#env.last
|
38
37
|
end
|
39
38
|
}
|
40
39
|
end
|
@@ -53,7 +52,6 @@ module Less
|
|
53
52
|
current.descend(node.selector, node) or raise MixinNameError, selectors.text_value
|
54
53
|
end.rules
|
55
54
|
env.rules += rules
|
56
|
-
#env.mix(rules)
|
57
55
|
end
|
58
56
|
end
|
59
57
|
}
|
@@ -157,7 +155,7 @@ module Less
|
|
157
155
|
# height: 100%;
|
158
156
|
#
|
159
157
|
rule declaration
|
160
|
-
ws name:(ident / variable) s ':'
|
158
|
+
ws name:(ident / variable) s ':' ws expressions tail:(ws ',' ws expressions)* s (';'/ ws &'}') ws {
|
161
159
|
def build env
|
162
160
|
result = all.map {|e| e.build(env) if e.respond_to? :build }.compact
|
163
161
|
env << (name.text_value =~ /^@/ ?
|
@@ -242,7 +240,15 @@ module Less
|
|
242
240
|
# div / .class / #id / input[type="text"] / lang(fr)
|
243
241
|
#
|
244
242
|
rule element
|
245
|
-
((class / id / tag / ident) attribute* ('(' (selector /
|
243
|
+
((class / id / tag / ident) attribute* ('(' ([a-zA-Z]+ / pseudo_exp / selector / [0-9]+) ')')?)+
|
244
|
+
/ attribute+ / '@media' / '@font-face'
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# 4n+1
|
249
|
+
#
|
250
|
+
rule pseudo_exp
|
251
|
+
'-'? ([0-9]+)? 'n' ([-+] [0-9]+)?
|
246
252
|
end
|
247
253
|
|
248
254
|
#
|
data/spec/css/css-3.css
CHANGED
@@ -13,5 +13,8 @@ input[type="text"].class#id[attr=32]:not(1) { color: white; }
|
|
13
13
|
div#id.class[a=1][b=2].class:not(1) { color: white; }
|
14
14
|
ul.comma > li:not(:only-child)::after { color: white; }
|
15
15
|
ol.comma > li:nth-last-child(2)::after { color: white; }
|
16
|
+
li:nth-child(4n+1) { color: white; }
|
17
|
+
li:nth-child(-5n) { color: white; }
|
18
|
+
li:nth-child(-n+2) { color: white; }
|
16
19
|
a[href^="http://"], a[href$="http://"] { color: black; }
|
17
20
|
p::before { color: black; }
|
data/spec/less/css-3.less
CHANGED
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.2.
|
4
|
+
version: 1.2.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-
|
12
|
+
date: 2009-11-18 00:00:00 -05:00
|
13
13
|
default_executable: lessc
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|