Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cowboyd/less.rb
Leaner CSS, in your browser or Ruby (via less.js).
https://github.com/cowboyd/less.rb
Last synced: about 2 months ago
JSON representation
Leaner CSS, in your browser or Ruby (via less.js).
- Host: GitHub
- URL: https://github.com/cowboyd/less.rb
- Owner: cowboyd
- Created: 2010-08-13T12:17:16.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T22:28:02.000Z (over 7 years ago)
- Last Synced: 2024-06-19T12:47:21.772Z (3 months ago)
- Language: Ruby
- Homepage: http://lesscss.org
- Size: 420 KB
- Stars: 121
- Watchers: 12
- Forks: 79
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
Awesome Lists containing this project
- awesome-ruby - Less - Leaner CSS, in your browser or Ruby. (Assets)
README
# less.rb
The **dynamic** stylesheet language.
[![Build Status](https://secure.travis-ci.org/cowboyd/less.rb.png)](http://travis-ci.org/cowboyd/less.rb)
## About
These are Ruby bindings for the next generation LESS, which is implemented in JavaScript
For more information, visit .
## Usage
less.rb exposes the `less.Parser` constructor to ruby code via `Less::Parser`. You can instate it
context free:```ruby
parser = Less::Parser.new
```or with configuration options:
```ruby
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 !
```ruby
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