适用于 Linux 的 Less 编译器

发布于 2024-12-02 00:54:23 字数 74 浏览 6 评论 0原文

有没有像less.app这样的东西可以将LESS编译成CSS?我不关心 GUI,也不想通过 NPM(node.js 包管理器)安装它。

Is there a something like less.app that can compile LESS into CSS? I don't care about a GUI and don't want to install it via NPM (node.js package manager.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

美男兮 2024-12-09 00:54:24

您还可以使用这个:http://wearekiss.com/simplless,它具有漂亮的 GUI 和自动观看过程编辑时更新文件。

You can also use this : http://wearekiss.com/simpless with a beautiful GUI and the watching process to automatically update the file when editing.

溺ぐ爱和你が 2024-12-09 00:54:24

在 fedora 或 centos 发行版中你应该

$ sudo yum install rubygems
$ sudo yum install gcc-c++
$ sudo yum install ruby-devel     
$ sudo gem install less
$ sudo gem install therubyracer 

$ lessc yourLessFile.less > yourCssFile.css

in fedora or centos distribution you should

$ sudo yum install rubygems
$ sudo yum install gcc-c++
$ sudo yum install ruby-devel     
$ sudo gem install less
$ sudo gem install therubyracer 

$ lessc yourLessFile.less > yourCssFile.css
时常饿 2024-12-09 00:54:24

我创建了一个wxPython GUI应用程序,它使用node.js less编译器。现在还处于非常早期的阶段。邀请每个人做出贡献。我计划让它与 MacOS 的 LessCSS 应用程序非常相似。

https://github.com/luislobo/Lobo-LessCSS-Compiler

I have created a wxPython GUI app that uses node.js less compiler. It is on very early stage right now. Everyone's invited to contribute. I'm planning to make it very similar to MacOS's LessCSS App.

https://github.com/luislobo/Lobo-LessCSS-Compiler

ぃ弥猫深巷。 2024-12-09 00:54:24

一种解决方案是此处讨论的 bash 脚本:https://www.maltheborch。 com/2011/09/less-app-on-linux
并可在此处作为要点: https://gist.github.com/malthe/1234308

需要node、lessc和inotify-tools(一个用于监视文件更改的小库)。只需将其放入文件中,使该文件可执行,然后使用目录作为参数运行它。

缺点是,虽然它会递归地监视目录,但它只会编译修改过的文件 - 它无法自动编译导入您正在处理的文件的 less 文件。

更新:类似的选项是这个稍微复杂的 bash 脚本,它添加了一些功能: http://code.krml.fr/less.app

One solution is a bash script discussed here: https://www.maltheborch.com/2011/09/less-app-on-linux
And available as a gist here: https://gist.github.com/malthe/1234308

It requires node, lessc, and inotify-tools (a small library for watching changes to files.) Simply throw it in a file, make that file executable, then run it with a directory as the argument.

The downside is that while it will watch a directory recursively, it will only compile whichever file was modified--it doesn't have the ability to automatically compile the less files which import the one you're working on.

Update: A similar option is this slightly more complex bash script which adds a few features: http://code.krml.fr/less.app

我还不会笑 2024-12-09 00:54:24

我知道,这个答案相当“太晚了”,但我最近尝试为 Linux 构建一个简单的 GUI。使用 JAVA 和 less.js,它不仅仅是 Linux,而且是跨平台的。
Simpless 不再受支持(从他们的博客中写的 1.3 开始),Crunch 使用 Adob​​e Air,这也已经过时了。

这是我的项目: http://project.splashfish.de/Le-css/

I know, that this answer is quite "too late", but I recently tried to build a simple gui for linux. With JAVA and the less.js it is not just linux, but cross-platform.
Simpless isn't supported anymore (since 1.3 as written in their blog) and Crunch uses Adobe Air which is also out of date.

here is my project: http://project.splashfish.de/Le-css/

眼睛会笑 2024-12-09 00:54:24

对于 java,有一个名为 wro4j 的开源工具。

它使用 rhino 作为底层引擎来将 less 编译为 css,但如果您的环境支持,也可以使用 node.js。

For java there is an open source tool called wro4j.

It uses rhino as underlying engine for compiling less to css, but can also use node.js if it is supported on your environment.

三生殊途 2024-12-09 00:54:23

虽然建议使用node.js版本,您可以将 less 安装为 ruby​​ gem:

sudo apt-get install rubygems1.8 ruby1.8-dev
sudo gem install rubygems-update
sudo gem update rubygems
sudo gem install less

并使用 /var/lib/gems/1.8/bin/lessc 中的 lessc ,因此您可能需要创建符号链接:

sudo ln -s /var/lib/gems/1.8/bin/lessc /usr/bin/

或将 ruby​​ gems 目录添加到 PATH 变量:

export PATH=/var/lib/gems/1.8/bin:$PATH

编辑:

使用 lessc 如此处所述

命令行使用

Less 带有一个二进制文件,它允许您从
命令行,如下所示:

$ lessc styles.less

这会将编译后的 CSS 输出到 stdout,您
然后可以将其重定向到您选择的文件:

$ lessc styles.less >样式.css

要输出缩小的 CSS,只需传递
-x 选项。

Although using node.js version is recommended, you can install less as ruby gem:

sudo apt-get install rubygems1.8 ruby1.8-dev
sudo gem install rubygems-update
sudo gem update rubygems
sudo gem install less

and than use lessc which is in /var/lib/gems/1.8/bin/lessc, so you may want to create symlink:

sudo ln -s /var/lib/gems/1.8/bin/lessc /usr/bin/

or add ruby gems dir to PATH variable:

export PATH=/var/lib/gems/1.8/bin:$PATH

EDIT:

Using lessc as described here:

Command-line usage

Less comes with a binary, which lets you invoke the compiler from the
command-line, as such:

$ lessc styles.less

This will output the compiled CSS to stdout, you
may then redirect it to a file of your choice:

$ lessc styles.less > styles.css

To output minified CSS, simply pass
the -x option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文