문제

I have my project laid out like so:

-Project
  -css
    -import.scss
    -_sass/
      main.scss

The contents of import.scss are:

---
---

@import "main.scss";

What I expected to happen was for main.scss to be imported into import.scss, then, import.scss would compile to import.css within the genrated _site/ directory.

Instead, I get the following error

Conversion error: There was an error converting 'css/import.scss'.
jekyll 2.0.3 | Error:  Invalid CSS after "-": expected number or function, was "--"

I'm guessing it's complaining about the YAML front-matter at the top of import.scss, but I'm unsure what the solution is.

도움이 되었습니까?

해결책

I had the same error, but here was my fix: use the “---” YAML front-matter only on the /css/*.scss files (e.g. your import.scss), but not on the partials.

The error seems to be referring to front-matters in the partials (/_scss) files. Once I took though out, the Sass started compiling again.

Hope this helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top