LESS @import 似乎不起作用

发布于 2025-01-06 22:50:01 字数 405 浏览 2 评论 0原文

使用命令行程序 lessc 按照本指南在 Ubuntu 计算机上安装,似乎没有按照我的预期编译 @import 规则。

$ echo '@import "inc.less"' > test.less
$ echo 'body { background: pink }' > inc.less
$ lessc test.less

输出是一个空行。我期待的是 inc.less 的内容。我在这里做错了什么吗?

Using the command line program lessc installed by following this guide on a Ubuntu machine, don't seem to compile @import rules as I expected.

$ echo '@import "inc.less"' > test.less
$ echo 'body { background: pink }' > inc.less
$ lessc test.less

The output is an empty line. I expected the contents of inc.less. Am I doing something wrong here?

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

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

发布评论

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

评论(1

时光清浅 2025-01-13 22:50:01

尝试 @import "inc";

不要使用 .less 扩展名。我还认为你需要一个分号。

例如,以下几行对我有用:

@import "blueprint/screen";
@import "blueprint/ie";

a, a:link, a:visited, a:hover, a:active
{
    text-decoration:none;
    color:#FF0000;
}

blueprint/screen.lessblueprint/ie.less 导入文件中。

Try @import "inc";

Don't use the .less extension. I also think you need a semicolon.

For example, here's a couple of lines that are working for me:

@import "blueprint/screen";
@import "blueprint/ie";

a, a:link, a:visited, a:hover, a:active
{
    text-decoration:none;
    color:#FF0000;
}

That imports blueprint/screen.less and blueprint/ie.less into the file.

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