根据this question可以从less v导入css文件.1.4.0.
我尝试使用 gulp-less
任务,但它不起作用.
有什么方法可以像这样导入 css 文件: @import "../spritesheet.css";
with nodeJS gulp?
According to this question it's possible to import css file from less v.1.4.0.
I tried to use gulp-less
task, and it's not working.
There's any way to import css file like this: @import "../spritesheet.css";
with nodeJS gulp?
有几种方法可以在 LESS 中包含文件,这取决于您的需要,使用 @import ([keyword]) "filename"
.
There are several ways to include files in LESS, depending on what you need, using @import ([keyword]) "filename"
.
允许的关键字是:
Lesscss.org - 导入选项
我不清楚你的用例是什么,但如果你想在 LESS 文件中进一步使用 spritesheet.css
的内容(例如扩展你的 spritesheet 中定义的类),你需要 (less)
关键字.
It's not clear to me what your use case is, but if you want to use the contents of spritesheet.css
further on in your LESS file (for example extending classes defined in your spritesheet) you need the (less)
keyword.
如果您只想将 spritesheet.css
的内容包含到输出文件中,而根本不从 LESS 文件中访问它们,请坚持使用 (inline)
.
If you just want to include the contents of spritesheet.css
into your output file without accessing them from within the LESS file at all, stick with (inline)
.
这篇关于使用 nodejs gulp 在 Less 中导入 .css 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!