Project

less

No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Invoke the Less CSS compiler from Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.2.7
 Project Readme

less.rb

The dynamic stylesheet language.

http://lesscss.org

Build Status

About

These are Ruby bindings for the next generation LESS, which is implemented in JavaScript

For more information, visit http://lesscss.org.

Usage

less.rb exposes the less.Parser constructor to ruby code via Less::Parser. You can instate it context free:

parser = Less::Parser.new

or with configuration options:

parser = Less::Parser.new :paths => ['./lib', 'other/lib'], :filename => 'mystyles.less'

Once you have a parser instantiated, you can parse code to get your AST !

tree = parser.parse(".class {width: 1+1}") # => Less::Tree
tree.to_css #=> .class {\n  width: 2;\n}\n
tree.to_css(:compress => true) #=> .class{width:2;}

Development

This repository contains less.js as a submodule, so to run the tests, you'll need to grab that code as well. To do that, run git submodule update --init from the root directory of the project.

To run the tests:

bundle
rake

License

less.rb is licensed under the same terms as less.js

See lib/js/LICENSE file.

copyright 2011,2012 Charles Lowell