Windows 上更少的 CSS

发布于 2024-09-04 06:40:13 字数 535 浏览 8 评论 0原文

尝试在我的 Windows 机器上设置 LESS for CSS,我安装了 ruby​​ 和 ruby​​gems 并按照 说明完全正确。

我已将 teststyle.less 放入 C:\ 中。
当我输入

lessc teststyle.less

将其编译为 .css 文件时,出现错误:

The filename, directory name, or volume label syntax is incorrect.

Out of thoseimited with LESS, do all of you have a Solution to my Problem?
是不是我安装的时候搞砸了?

Trying to set up LESS for CSS on my Windows box, I've installed ruby and rubygems and followed the instructions exactly.

I have put teststyle.less in C:\.
When I type

lessc teststyle.less

to compile it into a .css file, I get an error:

The filename, directory name, or volume label syntax is incorrect.

Out of those familiar with LESS, do any of you have a solution to my problem?
Did I mess up the install?

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

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

发布评论

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

评论(9

始终不够 2024-09-11 06:40:13

如果你不想在 Windows 上使用 GUI 编译 LESS,有一个干净的方法可以在 Windows 命令行上获取 lessc 命令。它只需要你安装node.js,无论如何,这是原始lessc所需要的。

因此,安装node.js (http://nodejs.org/) 并安装node.js 的“less”模块。后者还提供 lessc 可执行文件(Windows 上的 lessc.cmd),因此您只需确保它位于 Windows 中的 PATH 下即可。

如果您还没有 Node.js,请参阅以下分步说明:

  • 安装 Node.js (http://nodejs.org/)
  • 在新的命令行中,进入node.js安装目录(node.exe所在目录),执行 >; npm install less (确保仅从 Node.js 安装目录执行此操作)
  • 后者下载 Node.js 的 less 模块,以及 lessc.cmdnode_modules/。 bin/ 目录。将此目录添加到 PATH
  • 现在,在新的命令行中,您可以像往常一样使用 lessc

来源:http://pragmatictim.blogspot.fr/2012/08/developing-with-less-on-windows-getting.html

If you don't want to use GUI to compile LESS on Windows, there is a clean way to get lessc command on Windows command line. It only requires you to install node.js, which is required by original lessc anyway.

So, install node.js (http://nodejs.org/) and install "less" module for node.js. The latter provides lessc executable (lessc.cmd on Windows) as well, so you should only make sure it gets under your PATH in Windows.

If you don't have node.js yet, here are step-by-step instructions:

  • Install node.js (http://nodejs.org/)
  • In new command-line, go to node.js installation directory (where node.exe is located), and execute > npm install less (make sure you do so from node.js installation directory only)
  • Latter downloads less module for node.js, as well as lessc.cmd to node_modules/.bin/ directory. Add this directory to PATH
  • Now, in new command line you may enjoy the use of lessc as usual

Source: http://pragmatictim.blogspot.fr/2012/08/developing-with-less-on-windows-getting.html

揪着可爱 2024-09-11 06:40:13

您应该查看 http://www.dotlesscss.org/,较少移植到 C# 并专门为 .网。您可以使用处理程序或编译。

使用了六个月左右,非常好。

哎呀...看到了窗户并假定了点网,也许那不是您的环境。如果没有的话,没关系...

You should look at http://www.dotlesscss.org/, less ported to C# and specifically designed for .NET. You can use either a handler or compile.

Been using it for about six months, it's great.

Oops...saw windows and assumed dot net, perhaps that's not your environment. If not, never mind...

伪装你 2024-09-11 06:40:13

编辑:

lessc 现在可以在 Windows 上运行。请参阅有关命令行 LESS 工具的 Github 页面安装和使用说明。 包含 LESS GUI 列表的 Github 页面 工具也可能很有趣。

原始答案:

less.js 的 lessc 命令行工具在 Windows 上不起作用。如果您想要命令行编译 LESS 文件,您应该查看 这篇文章

另请务必查看 WinLess。 WinLess 是 LESS 的编译器(带有 GUI)。 WinLess 可以监视您的 LESS 文件,并在它们发生更改时自动编译它们。
如果您在项目中使用 Visual Studio,您还应该查看 winless.org 的 BuildEventScript

当您使用不同的程序编译 LESS 代码时,请务必检查正在使用哪个编译器。如果您使用的程序使用不同的编译器,您应该注意互操作性问题(LESS 代码可以在一个编译器上正常工作,但不能在另一个编译器上正常工作)。

Edit:

lessc does work on Windows now. See the Github page about commandline LESS tools for installation and usage instructions. The Github page with a list of LESS GUI tools might also be interesting.

Original answer:

The lessc command line tool for less.js doesn't work on Windows. If you want command line compiling of your LESS files you should check out this post.

Also be sure to check out WinLess. WinLess is a compiler (with GUI) for LESS. WinLess can watch your LESS files, and automatically compile them when they have changed.
If you are using Visual Studio for your projects you should also check out the BuildEventScript of winless.org.

Be sure to check which compiler is being used when you are using different programs to compile your LESS code. If you are using programs which use different compilers you should watch out for interoperability issues (LESS code working correctly with one compiler, but not with another).

疯狂的代价 2024-09-11 06:40:13

仅供参考,我发现这个 Windows 命令行工具将 LESS 编译为 CSS 很有用。它使用 less.js 来进行编译。命令语法不是很优雅,但效果很好。

https://github.com/duncansmart/less.js-windows

FYI, I found this Windows command line tool to compile LESS into CSS useful. It uses less.js to do the compilation. The command syntax is not very graceful, but it works well.

https://github.com/duncansmart/less.js-windows

少年亿悲伤 2024-09-11 06:40:13

我刚刚开始使用 Crunch 来编译 Bootstrap 非常棒。它基于 Adob​​e Air 构建,如果您还没有安装它,则必须安装它。

I just started using Crunch to compile Bootstrap and its pretty awesome. Its built on Adobe Air, which you will have to install if you don't already have it.

情话难免假 2024-09-11 06:40:13

我想我发现了问题。在我的第一次安装中,我安装到 C:\Program Files\Ruby
所以我卸载并尝试了默认的“C:\Ruby”安装路径。似乎解决了这个问题,现在可以正常工作了。谢谢。

I think I found the problem. In my first installation I installed to C:\Program Files\Ruby
so I uninstalled and tried the default 'C:\Ruby' install path. Seems to fix the problem and it now works correctly. Thanks.

来世叙缘 2024-09-11 06:40:13

我有一个重新编译的 DotlessCss 版本,它可以从标准输入接受更少的代码,并将 css 代码输出到标准输出。我已将其附加在以下链接适用于 Windows 的 LESS CSS 编译器

I have a recompiled version of DotlessCss that can accept less code from standard input and output the css code to the standard output. I have attached it at the following link LESS CSS Compiler for Windows

吖咩 2024-09-11 06:40:13

只有这个 https://github.com/leafo/lessphp PHP 编译器没有因我的疯狂项目而崩溃LESS 中导入 CSS 的结构等。

用于将 LESS 编译为 CSS 的非常简单的 shell 命令:

plessc input.less > output.css

Only this https://github.com/leafo/lessphp PHP compiler didn't crashed with my crazy project structure with CSS imports in LESS, etc.

Very simple shell command for compiling LESS to CSS:

plessc input.less > output.css
故人的歌 2024-09-11 06:40:13

您可以使用 Windows 版 Prepros 应用。它可以编译 less、sass、jade、stylus、markdown、coffeescript 和 haml,并具有实时浏览器刷新功能。

You can use Prepros App for windows. It can compile less, sass, jade, stylus, markdown, coffeescript and haml with live browser refresh.

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