Node-SASS Compiler fails - Invalid CSS
SCSS files use the .scss extension, not .sass. The two formats have a different syntax.
Read about the differences here: https://responsivedesign.is/articles/difference-between-sass-and-scss
Sass Invalid CSS Error: expected expression
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.
node-sass invalid CSS
The syntax is incorrect for node-sass.
You have defined the font variable correctly in fonts.scss but you need to import the font file into your Nav.scss file if you haven't already with:
@import "PATH/fonts.scss";
You then just need to reference the variable like so:
font-family: $roboto;
SassError: Invalid CSS expected expression (e.g. 1px, bold)
Node-sass causes this problem to me too. I fixed it using sass
instead of node-sass
.
Just run npm install sass
and should work.
Sass invalid css error on compile in live sass compiler
It looks like you're using the .sass file extension for index.sass
for a scss file. You need to change it to use the scss
file extension for it to compile.
See also:
Sass Invalid CSS Error: "expected expression"
Why is node-sass throwing Invalid CSS after \ @include corners\: expected \}\, was \.rounded;\
Node-sass, which is libsas based, doesn't currently support the @use
syntax, only dart-sass does https://sass-lang.com/documentation/at-rules/use
Related Topics
Firefox-CSS: Border-Radius Issue for Pseudo-Element "Before"
Angular Materials Won't Apply Styles to Components
How to Position Button Sprites CSS
@Font-Face Not Working on Wordpress Site
Extend Only First Level on Sass
What Does The Smiley Face ":)" Mean in CSS
How to Import CSS from Node_Modules in Webpack Angular2 App
How to Position Elements to The Right in Md-Toolbar
How to Center an Image Horizontally and Align It to The Bottom of The Container
How to Change Bootstrap Carousel Indicators into Dots
Center Div in Parent with Only Min-Height, and Child May Without Height & with Relative Position
@Font-Face Does Not Work Properly for Italic/Bold Fonts
Generate Img Src Data Uri for Svg with '<Use>' Elements
Stopping Content from Getting Pushed Down Due to Overlap in Bootstrap
Free Tools to Speed Up Web Development