如何使用Jekyll将CSS导入SCSS文件?

如何使用Jekyll将CSS导入SCSS文件?,jekyll,Jekyll,这是style.scss在css文件夹中,它将所有导入正确地组合在一个文件中,以\u site/css/style.css,但它不包括normalize.css --- --- @charset "utf-8"; @import "../../node_modules/normalize.css/normalize.css"; @import "variables"; @import "general"; @import "navigation"; @import "intro"; 只有将

这是
style.scss
css
文件夹中,它将所有导入正确地组合在一个文件中,以
\u site/css/style.css
,但它不包括
normalize.css

---
---

@charset "utf-8";

@import "../../node_modules/normalize.css/normalize.css";
@import "variables";
@import "general";
@import "navigation";
@import "intro";
只有将扩展名更改为
normalize.scss

---
---

@charset "utf-8";

@import "../../node_modules/normalize.css/normalize.css";
@import "variables";
@import "general";
@import "navigation";
@import "intro";
如果我像这样跳过扩展,那么Jekyll甚至不会编译(错误是
导入失败,找不到或无法读取


如何使用Jekyll将CSS导入SCSS文件?

你可以在这篇文章中找到答案:

资料来源:


看起来这是一个常见问题,请参阅此答案以了解详细信息,请务必阅读评论,它们应该会有帮助:
CSS @import Directives

Sass is now more intelligent about when to compile @import directives to plain > CSS. Any of the following conditions will cause a literal CSS @import:>

Importing a path with a .css extension (e.g. @import "foo.css").
Importing a path with a media type (e.g. @import "foo" screen;).
Importing an HTTP path (e.g. @import "http://foo.com/style.css").
Importing any URL (e.g. @import url(foo)).
The former two conditions always worked, but the latter two are new.