Sass File Not Generating CSS: "expected expression" Error
When compiling a Sass file to CSS, you may encounter an "expected expression" error. This typically occurs when the Sass syntax is incorrect.
In this instance, the error message indicates that a problem occurred after "80%". Upon examining the provided Sass file, we notice that the file extension is .sass, which is for the _old Sass syntax_. However, the Sass version used (3.1.10) is for the _new SCSS syntax_.
Cause of the Error:
The .sass file extension is used for the original Sass language, which has different syntax rules than SCSS (Sassy CSS). In SCSS, semicolons are not required after declarations, while they are required in the original Sass syntax.
Solution:
To resolve the issue, rename the file with the .scss extension. This will indicate to the Sass compiler that the file uses the SCSS syntax, allowing it to be compiled correctly.
Updated .scss File:
/* style.scss */ #navbar { width: 80%; height: 23px; }
The above is the detailed content of Why Am I Getting an 'Expected Expression' Error When Compiling My Sass File?. For more information, please follow other related articles on the PHP Chinese website!