最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - less css server-side, but without node.js? - Stack Overflow

programmeradmin4浏览0评论

Yes, I know that less was in first place written for node.js. But I really want to use it without adding node.js to my server, or learning how it works.

Is there some implementations of less written in other languages? Or maybe something similar to less?

Yes, I know that less was in first place written for node.js. But I really want to use it without adding node.js to my server, or learning how it works.

Is there some implementations of less written in other languages? Or maybe something similar to less?

Share Improve this question asked Aug 15, 2011 at 7:31 NamelessNameless 2,3664 gold badges24 silver badges30 bronze badges 1
  • Here's how to run it server-side on Linux without Node: stackoverflow./questions/7245826/less-css-piler-for-linux – Jonatan Littke Commented Sep 27, 2011 at 9:08
Add a ment  | 

4 Answers 4

Reset to default 5

You could take a look at SCSS. The pilation of files into CSS is done by a Ruby script which is very easy to get set up (even on Windows), and the syntax and feature list is almost identical. I'd even say that the documentation of SCSS is better than LESS.

That said, I have managed to get LESS pilation running locally by running the file in a Javascript engine (in my case, Komodo Edit's macro system is powered by Javascript, but it could work with Rhino or V8). You do have to modify the source a little, to simulate the window object. I got a lot of help by looking at the code of the Less Engine project, which basically allows Less to be executed within a JVM.

There is a Windows LESS piler for .NET and a standalone version of it as well. I find this latter considerably better (i.e. fewer bugs) than less.js, although both are pretty odd in the way they handle ments: less.js doesn't understand two ments in a row, and lessc.exe doesn't understand ments inside selectors. I really don't see the point of piling the .less file at the client once per page download per client when you could have done it once for the universe at build time.

There is also a Python implementation of SCSS: http://packages.python/scss/. It works quite well and includes a watch folder function.

There is very nice PHP class: http://leafo/lessphp/

发布评论

评论列表(0)

  1. 暂无评论