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.
是的,我知道为node.js写的少了一个。但我真的想在不将node.js添加到我的服务器的情况下使用它,或者学习它是如何工作的。
Is there some implementations of less written in other languages? Or maybe something similar to less?
是否有一些较少用其他语言编写的实现?或者类似于更少的东西?
4 个解决方案
#1
5
You could take a look at SCSS. The compilation 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.
你可以看看SCSS。将文件编译成CSS是由Ruby脚本完成的,它很容易设置(即使在Windows上),语法和功能列表几乎完全相同。我甚至说SCSS的文档比LESS好。
That said, I have managed to get LESS compilation 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.
也就是说,我已经设法通过在Javascript引擎中运行文件来在本地运行LESS编译(在我的例子中,Komodo Edit的宏系统由Javascript驱动,但它可以与Rhino或V8一起使用)。您必须稍微修改源,以模拟窗口对象。通过查看Less Engine项目的代码,我得到了很多帮助,它基本上允许在JVM中执行Less。
#2
1
There is a Windows LESS compiler 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 comments: less.js doesn't understand two comments in a row, and lessc.exe doesn't understand comments inside selectors. I really don't see the point of compiling 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.
有一个用于.NET的Windows LESS编译器以及它的独立版本。我发现后者比less.js更好(即更少的bug),虽然它们处理注释的方式都很奇怪:less.js连续不理解两条注释,而且lessc.exe不理解注释内部选择器。我真的没有看到每个客户端每次页面下载时在客户端编译.less文件的意义,当你可以在构建时为Universe完成一次。
#3
1
There is also a Python implementation of SCSS: http://packages.python.org/scss/. It works quite well and includes a watch folder function.
还有一个SCSS的Python实现:http://packages.python.org/scss/。它工作得很好,包括一个监视文件夹功能。
#1
5
You could take a look at SCSS. The compilation 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.
你可以看看SCSS。将文件编译成CSS是由Ruby脚本完成的,它很容易设置(即使在Windows上),语法和功能列表几乎完全相同。我甚至说SCSS的文档比LESS好。
That said, I have managed to get LESS compilation 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.
也就是说,我已经设法通过在Javascript引擎中运行文件来在本地运行LESS编译(在我的例子中,Komodo Edit的宏系统由Javascript驱动,但它可以与Rhino或V8一起使用)。您必须稍微修改源,以模拟窗口对象。通过查看Less Engine项目的代码,我得到了很多帮助,它基本上允许在JVM中执行Less。
#2
1
There is a Windows LESS compiler 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 comments: less.js doesn't understand two comments in a row, and lessc.exe doesn't understand comments inside selectors. I really don't see the point of compiling 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.
有一个用于.NET的Windows LESS编译器以及它的独立版本。我发现后者比less.js更好(即更少的bug),虽然它们处理注释的方式都很奇怪:less.js连续不理解两条注释,而且lessc.exe不理解注释内部选择器。我真的没有看到每个客户端每次页面下载时在客户端编译.less文件的意义,当你可以在构建时为Universe完成一次。
#3
1
There is also a Python implementation of SCSS: http://packages.python.org/scss/. It works quite well and includes a watch folder function.
还有一个SCSS的Python实现:http://packages.python.org/scss/。它工作得很好,包括一个监视文件夹功能。