Sass Invalid CSS Error: "expected expression"

CssSass

Css Problem Overview


I've just been following the Sass tutorial. For some reason though the Sass file is not correctly generating the css. The terminal says the css is invalid but I'm pretty sure it's not. I've tried changing it too just in case there was a problem...

What have I done wrong?

Sass Version: Sass 3.1.10

Error message:

error sass/test.sass (Line 3: Invalid CSS after "80%": 
expected expression (e.g. 1px, bold), was ";")

.sass file contents:

/* style.scss */
#navbar {
  width: 80%;
  height: 23px;
}

Css Solutions


Solution 1 - Css

Based on your error message (error sass/test.sass) I can tell you're using the .sass extension for a Scss file. Change your file name to style.scss.

Sass and Scss use two different and incompatible syntaxes.

Solution 2 - Css

Try either:

/* style.scss */
#navbar {
  width: 80%;
  height: 23px;
}

Or:

/* style.sass */
#navbar 
  width: 80%
  height: 23px

Note the difference in file extension and syntax.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTom RView Question on Stackoverflow
Solution 1 - Cssuser229044View Answer on Stackoverflow
Solution 2 - CsslincolngeView Answer on Stackoverflow