How to import CSS into SCSS file with Jekyll?

Viewed 1248

This is style.scss inside css folder, it correctly combines all imports in a single file to _site/css/style.css but it doesn't include normalize.css

It works only if I change extension to normalize.scss

---
---

@charset "utf-8";

@import "../../node_modules/normalize.css/normalize.css";
@import "variables";
@import "general";
@import "navigation";
@import "intro";

If I skip extension like this than Jekyll doesn't even compile (Error is Fail to import not found or unreadable)

@import "../../node_modules/normalize.css/normalize";

How to import CSS into SCSS file with Jekyll?

1 Answers

You may find your answer in this post: Import regular CSS file in SCSS file?

Source: 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.
Related