Invalid CSS after "-": expected 1 selector or at-rule, was "---" (SassC::SyntaxError)

I got this error that I don’t really understand why it happened. The error I got is this…

Error: Invalid CSS after “-”: expected 1 selector or at-rule, was “—” (SassC::SyntaxError)
on line 1:1 of _sass/main.scss
from line 1:1 of main.scss

My main.scss is this…

---
# Only the main Sass file needs front matter (the dashes are enough)
---

@import "main";

I have few other jekyll repo that is set up with minima theme to test it out. It was running fine but for this repo that show this error. I created it using “jekyll new --blank”.
What is required to make it run scss in assets/css/ without triggering the 'invalid CSS after “-”.

I do know that you need to put in front matter in main.scss to force it to convert that file into CSS.

Is there something I’m missing?

thanks

Never mind. I found the error. I overlooked the “_sass/main.scss” which has a front matter that shouldn’t be there since there should not be a front matter in any scss inside _sass except in assets.

John

1 Like