cloudhead-less 0.5.0

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/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ /*.css
2
+ *.tmproj
3
+ *.gem
4
+ pkg/
data/LICENSE ADDED
@@ -0,0 +1,179 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright (c) 2009 Alexis Sellier
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ LESS
2
+ ====
3
+ It's time CSS was done right – LESS is _leaner_ css.
4
+
5
+ Explained
6
+ ---------
7
+ LESS allows you to write CSS the way (I think) it was meant to, that is: with *variables*, *nested rules* and *mixins*!
8
+
9
+ ### Here's some example LESS code:
10
+
11
+ @dark: #110011;
12
+ .outline { border: 1px solid black }
13
+
14
+ .article {
15
+ a { text-decoration: none }
16
+ p { color: @dark }
17
+ .outline;
18
+ }
19
+
20
+ ### And the CSS output it produces:
21
+
22
+ .outline { border: 1px solid black }
23
+ .article > a { text-decoration: none }
24
+ .article > p { color: #110011 }
25
+ .article { border: 1px solid black }
26
+
27
+ If you have CSS nightmares, just
28
+ $ lessc style.less
29
+
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ # Je::Specification.new do |s|
2
+ # s.name = "less"
3
+ # s.version = "0.1"
4
+ # s.date = Time.today.strftime("%Y-%m-%d")
5
+ # s.authors = ["cloudhead"]
6
+ # s.email = "alexis@cloudhead.net"
7
+ # s.summary = "LESS compiler"
8
+ # s.homepage = "http://www.lesscss.org"
9
+ # s.description = "Compiles LESS files into CSS"
10
+ # s.files = [
11
+ # "README",
12
+ # "bin/lessc",
13
+ # "lib/less.rb",
14
+ # "lib/less/command.rb",
15
+ # "lib/less/engine.rb",
16
+ # "lib/less/tree.rb"
17
+ # ]
18
+ #
19
+ # s.bindir = "bin"
20
+ # s.default_executable = "lessc"
21
+ # s.executables = "lessc"
22
+ # end
23
+
24
+ begin
25
+ require 'jeweler'
26
+ Jeweler::Tasks.new do |s|
27
+ s.name = "less"
28
+ s.authors = ["cloudhead"]
29
+ s.email = "alexis@cloudhead.net"
30
+ s.summary = "LESS compiler"
31
+ s.homepage = "http://www.lesscss.org"
32
+ s.description = "Compiles LESS files into CSS"
33
+ end
34
+ rescue LoadError
35
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
36
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.5.0
data/bin/lessc ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.dirname(__FILE__) + "/../lib"
4
+
5
+ require 'optparse'
6
+ require 'less'
7
+
8
+ CSS = '.css'
9
+
10
+ # Argument defaults
11
+ options = {
12
+ :watch => false,
13
+ :compress => false
14
+ }
15
+
16
+ # Get arguments
17
+ opts = OptionParser.new do |o|
18
+ o.banner = "usage: lessc source [destination] [--watch]"
19
+ o.separator ""
20
+
21
+ # Watch mode
22
+ o.on("-w", "--watch", "watch for changes") do
23
+ options[:watch] = true
24
+ end
25
+
26
+ # Compress
27
+ o.on("-c", "--compress", "compress css file") do
28
+ options[:compress] = true
29
+ end
30
+
31
+ o.separator ""
32
+
33
+ # Help
34
+ o.on_tail("-h", "--help", "show this message") do
35
+ puts opts
36
+ exit
37
+ end
38
+
39
+ # Version
40
+ o.on_tail("-v", "--version", "show version") do
41
+ puts "Less Compiler " + Less::VERSION
42
+ exit
43
+ end
44
+ end
45
+
46
+ opts.parse! # Parse arguments into `options` hash
47
+
48
+ # Get source and destintation from command line
49
+ case ARGV.size
50
+ when 1
51
+ options[:source] = ARGV[ 0 ]
52
+ when 2
53
+ options[:source] = ARGV[ 0 ]
54
+ options[:destination] = ARGV[ 1 ]
55
+ else
56
+ puts opts
57
+ exit
58
+ end
59
+ options[:destination] = (options[:destination] || options[:source]).gsub /\.(less|lss)/, CSS
60
+
61
+ Less::Command.new( options ).run!
data/less.gemspec ADDED
@@ -0,0 +1,48 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{less}
5
+ s.version = "0.5.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["cloudhead"]
9
+ s.date = %q{2009-05-19}
10
+ s.default_executable = %q{lessc}
11
+ s.description = %q{Compiles LESS files into CSS}
12
+ s.email = %q{alexis@cloudhead.net}
13
+ s.executables = ["lessc"]
14
+ s.extra_rdoc_files = [
15
+ "LICENSE",
16
+ "README.md"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "LICENSE",
21
+ "README.md",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "bin/lessc",
25
+ "less.gemspec",
26
+ "lib/less.rb",
27
+ "lib/less/command.rb",
28
+ "lib/less/engine.rb",
29
+ "lib/less/tree.rb",
30
+ "spec/spec.less"
31
+ ]
32
+ s.has_rdoc = true
33
+ s.homepage = %q{http://www.lesscss.org}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.1}
37
+ s.summary = %q{LESS compiler}
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 2
42
+
43
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
44
+ else
45
+ end
46
+ else
47
+ end
48
+ end
@@ -0,0 +1,76 @@
1
+ module Less
2
+ class Command
3
+ def initialize options
4
+ @source, @destination = options[:source], options[:destination]
5
+ @options = options
6
+ end
7
+ def watch?() @options[:watch] end
8
+ def compress?() @options[:compress] end
9
+
10
+ def run!
11
+ # little function which allows us to Ctrl-C exit inside the passed block
12
+ watch = lambda do |&block|
13
+ begin
14
+ block.call
15
+ rescue Interrupt
16
+ puts
17
+ exit 0
18
+ end
19
+ end
20
+
21
+ if watch?
22
+ log "Watching for changes in #@source ...Ctrl-C to abort.\n"
23
+ #
24
+ # Main watch loop
25
+ #
26
+ loop do
27
+ watch.call { sleep 1 }
28
+
29
+ # File has changed
30
+ if File.stat( @source ).mtime > File.stat( @destination ).mtime
31
+ log "Change detected... "
32
+ #
33
+ # Error loop
34
+ #
35
+ loop do
36
+ begin
37
+ compile
38
+ rescue SyntaxError
39
+ error = $!.message.split("\n")[1..-1].collect {|e| e.gsub(/\(eval\)\:\d+\:\s/, '') } * "\n"
40
+ log " errors were found in the .less file! \n#{error}\n"
41
+ log "Press [enter] to continue..."
42
+ watch.call do
43
+ $stdin.gets
44
+ print "} "
45
+ end
46
+ next # continue within the error loop, until the error is fixed
47
+ end
48
+ break # break to main loop, as no errors were encountered
49
+ end
50
+ end # if
51
+ end # loop
52
+ else
53
+ compile
54
+ end
55
+ end
56
+
57
+ def compile
58
+ begin
59
+ # Create a new Less object with the contents of a file
60
+ css = Less::Engine.new( File.read( @source ) ).to_css
61
+ css = css.delete " \n" if compress?
62
+ File.open( @destination, "w" ) do |file|
63
+ file.write css
64
+ end
65
+ puts "#{@destination.split('/').last} was updated!" if watch?
66
+ rescue Errno::ENOENT => e
67
+ abort "#{e}"
68
+ end
69
+ end
70
+
71
+ # Just a logging function to avoid typing '}'
72
+ def log s = ''
73
+ print '} ' + s.to_s
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,109 @@
1
+ module Less
2
+ class Engine < String
3
+ REGEXP = {
4
+ :path => /([#.][->#.\w]+)?( ?> ?)?@([\w\-]+)/, # #header > .title > @var
5
+ :selector => /[-\w #.>*_:]/, # .cow .milk > a
6
+ :values => /[-\w @>\/*+#%.,'"]/, # 10px solid #fff
7
+ :variable => /^@([\w\-]+)/ # @milk-white
8
+ }
9
+
10
+ def initialize s
11
+ super
12
+ @tree = Tree.new self.hashify
13
+ end
14
+
15
+ def compile
16
+ #
17
+ # Parse the variables and mixins
18
+ #
19
+ # We use symbolic keys, such as :mixins, to store LESS-only data,
20
+ # each branch has its own :mixins => [], and :variables => {}
21
+ # Once a declaration has been recognised as LESS-specific, it is copied
22
+ # in the appropriate data structure in that branch. The declaration itself
23
+ # can then be deleted.
24
+ #
25
+ @tree = @tree.traverse :leaf do |key, value, path, node|
26
+ matched = if match = key.match( REGEXP[:variable] )
27
+ node[:variables] ||= {}
28
+ node[:variables][ match.captures.first ] = value
29
+ elsif value == :mixin
30
+ node[:mixins] ||= []
31
+ node[:mixins] << key
32
+ end
33
+ node.delete key if matched # Delete the property if it's LESS-specific
34
+ end
35
+
36
+ #
37
+ # Evaluate mixins
38
+ #
39
+ @tree = @tree.traverse :branch do |path, node|
40
+ if node.include? :mixins
41
+ node[:mixins].each do |m|
42
+ @tree.find( :mixin, m.delete(' ').split('>') ).each {|k, v| node[ k ] = v }
43
+ end
44
+ end
45
+ end
46
+
47
+ #
48
+ # Evaluate the variables
49
+ #
50
+ @tree = @tree.traverse :leaf do |key, value, path, node|
51
+ convert = lambda do |key, value, node| # We declare this as a lambda, for re-use
52
+ if value.is_a?(String) && value.include?('@') # There's a var to evaluate
53
+
54
+ # Find its value
55
+ var = value.delete(' ').match( REGEXP[:path] ).captures.join
56
+ var = unless var.include? '>'
57
+ node.var( var ) || @tree.var( var ) # Try local first, then global
58
+ else
59
+ @tree.find :var, var.split('>') # Try finding it in a specific namespace
60
+ end
61
+
62
+ if var
63
+ node[ key ] = value.gsub REGEXP[:path], var # substitute variable with value
64
+ else
65
+ node.delete key # discard the declaration if the variable wasn't found
66
+ end
67
+ end
68
+ end
69
+
70
+ # Call `convert` on css properties, such as 'font-size: @big'
71
+ convert.call key, value, node
72
+
73
+ # Call `convert` on variables, such as '@dark: @light / 2'
74
+ if node.vars?
75
+ node.vars.each do |key, value|
76
+ convert.call key, value, node
77
+ end
78
+ end
79
+ end
80
+ end
81
+ alias render compile
82
+
83
+ def to_css
84
+ self.compile.to_css
85
+ end
86
+
87
+ def evaluate s
88
+ eval( s )
89
+ end
90
+
91
+ def hashify
92
+ #
93
+ # Parse the LESS structure into a hash
94
+ #
95
+ ###
96
+ # less: color: black;
97
+ # hashify: "color" => "black"
98
+ #
99
+ hash = self.gsub(/"/, "'"). # ""
100
+ gsub(/([@a-z\-]+):[ \t]*(#{ REGEXP[:values] }+);/, '"\\1" => "\\2",'). # Properties
101
+ gsub(/\}/, "},"). # Closing }
102
+ gsub(/([ \t]*)(#{ REGEXP[:selector] }+?)[ \t\n]*\{/m, '\\1"\\2" => {'). # Selectors
103
+ gsub(/([.#][->\w .#]+);/, '"\\1" => :mixin,'). # Mixins
104
+ gsub("\n\n", "\n"). # New-lines
105
+ gsub(/\/\/.*\n/, '') # Comments
106
+ eval "{" + hash + "}" # Return {hash}
107
+ end
108
+ end
109
+ end
data/lib/less/tree.rb ADDED
@@ -0,0 +1,67 @@
1
+ module Less
2
+ class Tree < Hash
3
+ def initialize init = {}
4
+ self.replace init
5
+ end
6
+
7
+ def var k
8
+ self[:variables] ? self[:variables][ k ] : nil
9
+ end
10
+
11
+ def vars?
12
+ self.include? :variables
13
+ end
14
+
15
+ def vars
16
+ self[:variables] ? self[:variables] : nil
17
+ end
18
+
19
+ def find what = :var, path = []
20
+ path.inject(self) do |branch, k|
21
+ if what == :var && k == path.last
22
+ branch[:variables][ k ]
23
+ else
24
+ branch = branch[ k ]
25
+ end
26
+ end
27
+ end
28
+
29
+ def traverse by = :leaf, path = [], &blk
30
+ #
31
+ # Traverse the whole tree, returning each leaf or branch (recursive)
32
+ #
33
+ ###
34
+ # Aside from the key & value,
35
+ # we yield the full path of the leaf, aswell as
36
+ # the branch which contains it (self).
37
+ #
38
+ self.each do |key, value| # `self` is the current node, starting with the trunk
39
+ if value.is_a? Hash and key != :variables # If the node is a branch, we can go deeper
40
+ path << key # Add the current branch to the path
41
+ self[ key ] = value.to_tree. # Make sure any change is saved to the main tree
42
+ traverse by, path, &blk # Recurse, with the current node becoming `self`
43
+ if by == :branch
44
+ yield path, self[ key ] # The node is a branch, yield it to the block
45
+ path.pop
46
+ end
47
+ elsif by == :leaf and key.is_a? String
48
+ yield key, value, path, self # The node is a leaf, yield it to the block
49
+ path.pop
50
+ else
51
+ next
52
+ end
53
+ end
54
+ self
55
+ end
56
+
57
+ def to_css css = []
58
+ self.traverse :branch do |path, node|
59
+ properties = node.inject("") do |s, (k, v)|
60
+ v.is_a?(String) ? (s + "#{k}: #{v}; ") : s # Add the property to the list
61
+ end
62
+ css << path * ' > ' + " { " + properties + "}" # Add the rule-set to the CSS
63
+ end
64
+ css.join "\n"
65
+ end
66
+ end
67
+ end
data/lib/less.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'less/command'
2
+ require 'less/engine'
3
+ require 'less/tree'
4
+
5
+ module Less
6
+ VERSION = '0.1'
7
+ end
8
+
9
+ class Hash
10
+ # Convert a hash into a Tree
11
+ def to_tree
12
+ Less::Tree.new self
13
+ end
14
+ end
data/spec/spec.less ADDED
@@ -0,0 +1,67 @@
1
+ // LESS
2
+ // the main color
3
+ @base-color: #fff;
4
+ @darker-color: @base-color / 2;
5
+
6
+ .dookoo a {
7
+ color: black;
8
+ }
9
+ .dookoo a {
10
+ font-family: "Verdana", 'Baka', serif;
11
+ }
12
+ .dookoo {
13
+ @fa: grey;
14
+ color: @fa;
15
+ line-height: 1999px;
16
+ }
17
+ .ccc {
18
+ color: black;
19
+ }
20
+ .ddd {
21
+ color: black;
22
+ }
23
+ .bbb {
24
+ color: black;
25
+ }
26
+ .aaa {
27
+ color: red;
28
+ }
29
+ .alt {
30
+ @base-color: green;
31
+ @darker-color: @base-color / 2;
32
+ @another-color: * > @base-color;
33
+ }
34
+ .altfoo { color: .alt > @base-color; }
35
+ .foo { border: 1px solid black; color: @base-color; }
36
+
37
+ #content {
38
+ font-size: 12px;
39
+ @some-color: blue;
40
+ #header {
41
+ .foo;
42
+ font-size: * 2;
43
+ }
44
+ #main-page {
45
+ #content > .small;
46
+ }
47
+ .small {
48
+ color: @base-color;
49
+ font-size: / 2;
50
+ .hover_controls {
51
+ line-height: 16px;
52
+ display: none;
53
+ color: #content > @some-color;
54
+ border: 1px solid #fff;
55
+ }
56
+ }
57
+ .small:hover {
58
+ background-color: #eee + #content > @some-color;
59
+ .hover_controls {
60
+ .dookoo;
61
+ display: inline-block;
62
+ }
63
+ }
64
+ }
65
+ .sidebar {
66
+ #content > .small;
67
+ }
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudhead-less
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - cloudhead
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-19 00:00:00 -07:00
13
+ default_executable: lessc
14
+ dependencies: []
15
+
16
+ description: Compiles LESS files into CSS
17
+ email: alexis@cloudhead.net
18
+ executables:
19
+ - lessc
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - LICENSE
24
+ - README.md
25
+ files:
26
+ - .gitignore
27
+ - LICENSE
28
+ - README.md
29
+ - Rakefile
30
+ - VERSION
31
+ - bin/lessc
32
+ - less.gemspec
33
+ - lib/less.rb
34
+ - lib/less/command.rb
35
+ - lib/less/engine.rb
36
+ - lib/less/tree.rb
37
+ - spec/spec.less
38
+ has_rdoc: true
39
+ homepage: http://www.lesscss.org
40
+ post_install_message:
41
+ rdoc_options:
42
+ - --charset=UTF-8
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ requirements: []
58
+
59
+ rubyforge_project:
60
+ rubygems_version: 1.2.0
61
+ signing_key:
62
+ specification_version: 2
63
+ summary: LESS compiler
64
+ test_files: []
65
+