.less CSS 监视功能只能在本地使用?
根据 http://fadeyev.net/2010/06/19/ lessjs-will-obsolete-css/ 我应该能够以更少的价格设置“监视”功能。
我主要直接在远程服务器上工作。通过 FTP 直接打开文件或使用通过网络找到的服务器。
这仍然有效吗?或者文件必须是本地的才能“观看”?
我正在使用Windows,如果这有什么区别的话。
非常感谢
According to http://fadeyev.net/2010/06/19/lessjs-will-obsolete-css/ I should be able to set up a "watch" feature for less.
I mainly work directly on remote servers. Either through opening up file directly through FTP or using a server found through a network.
Will this still work? Or do the files have to be local to be "watched"?
I'm using Windows if that makes a difference.
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
监视功能是在您自己的本地开发计算机上发生的事情。您可以在服务器上运行它,但它必须在后台不断运行,因此它可能不是最佳选择。 watch 选项不是 less.js 的功能,而是其他 LESS CSS 编译器的功能。编译操作通常是一次性操作,即您调用编译器,它会编译并返回到 shell 提示符。使用
-w
或--watch
开关,您的 LESS 编译器将监视您指定的 .less 文件,并在它们发生更改时立即进行转换。此监视功能是设计时实时编译器选项,而使用 less.js,您的 less 文件会在运行时转换。另一种选择是编译时操作,您可以在构建步骤中调用 less 编译器(如使用 Ant)。
红宝石
如果您在安装了 Ruby 的情况下执行
gem install less
,您将获得旧的命令行 Ruby 编译器。它不再由 Cloudhead 更新,因此它基本上不受支持,也没有获得任何新功能等。运行它时,您可以调用lessc input.less output.css -w
。如果末尾没有-w
开关,LESSC 将编译一次并返回到提示符。使用-w
开关,它将继续监视文件的更改,并在每次编辑文件时重新编译它。.NET
如果您有 DotLessCSS(您可能使用的是 Windows),您可以输入
dotless.Compiler input.less 输出。 css --watch
做同样的事情。PHP
如果您使用 LESSPHP,您还可以使用
plessc -w 输入从命令行调用它。 less output.css
,同样,-w
也会做同样的事情。苹果机
如果您使用的是 Mac,则可以使用 LESS.Air。指定您希望应用程序查看哪些文件,告诉它您希望它继续查看这些文件,它将在后台编译,无需命令行。
空气
在 Windows、Mac 或 Linux 上,您可以使用这个 less 解析器,它是 LESS 的克隆。空气。它的工作方式相同,但交叉兼容并在底层使用 less.js。
The watch feature is something that happens on your own local development computer. You could run it on your server, but it would have to run constantly in the background, so it's probably not the best option. The watch options is not a feature of less.js, but instead of other LESS CSS compliers. A compile operation is usually a one-time operation, i.e. you call the compiler, it compiles and returns you to the shell prompt. With the
-w
or--watch
switch, your LESS compiler will watch your specified .less file(s) and convert them as soon as they change.This watching features is a design-time live compiler option, whereas with less.js your less files are converted at run-time. Another alternative is a compile-time operation where you invoke a less compiler as part of a build step (like with Ant).
Ruby
If you do
gem install less
with Ruby installed, you get the old command-line Ruby compiler. It isn't kept up by Cloudhead anymore, so it's mostly unsupported and doesn't get any new features, etc. When you run it, you can calllessc input.less output.css -w
. Without the-w
switch at the end, LESSC will compile it one time and return you to your prompt. With the-w
switch, it will continue to watch the file for changes and recompile it each time you edit the file..NET
If you have DotLessCSS, (you're probably on windows) you can type
dotless.Compiler input.less output.css --watch
which does the same thing.PHP
If you are using LESSPHP, you can also call that from the command line with
plessc -w input.less output.css
, again, the-w
will do the same thing.Mac
If you are on a mac, you can use LESS.Air. Specify which files you want the app to look at, tell it you want it to keep watching those files, and it will compile in the background without the command line.
Air
On Windows, Mac or Linux, you can use this less parser which is a clone of LESS.Air. It works the same way, but is cross-compatible and uses less.js under the hood.