这是 css
文件夹中的 style.scss
,它正确地将所有导入合并到一个文件中到 _site/css/style.css
但它不包括 normalize.css
只有当我将扩展名更改为 normalize.scss
---
---
@charset "utf-8";
@import "../../node_modules/normalize.css/normalize.css";
@import "variables";
@import "general";
@import "navigation";
@import "intro";
如果我像这样跳过扩展,那么 Jekyll 甚至不会编译(错误是无法导入未找到或不可读
)
@import "../../node_modules/normalize.css/normalize";
如何使用 Jekyll 将 CSS 导入 SCSS 文件?
最佳答案
您可以在这篇文章中找到答案:Import regular CSS file in SCSS file?
来源:http://sass-lang.com/documentation/file.SASS_CHANGELOG.html#CSS__import_Directives
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.
https://stackoverflow.com/questions/46531547/