less-to-js
What it does
Turns .less
files into .js
files that can run in the browser or in node. (just does nothing in node)
hello.less
.hello .world color: lightenred, 20%;
turns into
hello.less.js
{if"undefined"!=typeof documentvar t=document;iftless_to_js__inserted=tless_to_js__inserted||{}!tless_to_js__insertedetless_to_js__insertede=!0;var s=t;s"textContent"in s?stextContent=e:sstyleSheetcssText=et0}".hello .world{color:#f66}";
Which can then be used in the browser or server. For example requried in a project using browserify
app.js
;
How to use it
Command Line
install
$ sudo npm install -g less-to-js
simply run it with file path globs that you want to compile
$ less-to-js src/**/*.css src/**/*.less
Node API
install
$ npm install less-to-js
Usage example
var less_to_js = ; var file = "./asdf.less"; ;
License
MIT