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

时间:2017-10-02 18:31:54

标签: jekyll

这是style.scss css文件夹内的_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";

时才有效
Fail to import not found or unreadable

如果我跳过这样的扩展而不是Jekyll甚至不编译(错误是@import "../../node_modules/normalize.css/normalize";

ConditionExpression

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

1 个答案:

答案 0 :(得分:0)

您可以在这篇文章中找到答案: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.