开发者

Less Compiler for Linux [closed]

开发者 https://www.devze.com 2023-04-01 08:01 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise开发者_StackOverflow中文版, but this question wil
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise开发者_StackOverflow中文版, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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.)


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.


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


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


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


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


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/


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消