2010-02-24 02:39:05 +08:00
|
|
|
less.js
|
|
|
|
=======
|
|
|
|
|
2010-03-07 07:19:36 +08:00
|
|
|
about
|
|
|
|
-----
|
|
|
|
|
|
|
|
less.js is the next evolution of [LESS](http://lesscss.org), eventually, it will become LESS 2.0.
|
|
|
|
less.js is a complete rewrite of LESS in JavaScript, and will be able to run directly in the browser,
|
|
|
|
as well as on the server, with node.js.
|
|
|
|
|
2010-04-23 07:15:11 +08:00
|
|
|
synopsis
|
|
|
|
--------
|
|
|
|
|
|
|
|
### in node.js
|
|
|
|
|
|
|
|
var less = require('less');
|
|
|
|
|
|
|
|
less.render(".class { width: 10px * 2 }", function (e, css) {
|
|
|
|
sys.puts(css); // .class { width: 20px }
|
|
|
|
});
|
2010-03-07 07:19:36 +08:00
|
|
|
|
2010-04-23 07:15:11 +08:00
|
|
|
### via the command-line (requires node)
|
2010-02-24 02:39:05 +08:00
|
|
|
|
2010-04-23 07:15:11 +08:00
|
|
|
bin/lessc style.less
|
2010-03-07 07:19:36 +08:00
|
|
|
|
2010-04-23 07:15:11 +08:00
|
|
|
### in the browser
|
2010-02-24 02:39:05 +08:00
|
|
|
|
2010-04-30 05:54:34 +08:00
|
|
|
First, run `make less` in the command line. It will the *less.js* file in *dist/*.
|
|
|
|
Then, you can use it as such:
|
|
|
|
|
2010-04-24 01:37:31 +08:00
|
|
|
<script src="less.js"></script>
|
|
|
|
<link rel="less" href="main.less" type="text/css">
|
2010-02-24 02:39:05 +08:00
|
|
|
|
2010-04-30 05:54:34 +08:00
|
|
|
To build a minified version, run `make min`
|