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"
error while compiling my sass code, how should i proceed from here on?
You need to check the encoding of your files. Check in the image you posted. The error message should explain what's going wrong. Looks like your file has been saved in a UTF-16 format. Make sure it's saved as a UTF-8 file and see what that does.
Take a look at https://stackoverflow.com/a/40365121/1248664 on changing your encoding in VS Code
Getting error when trying to compile SASS to CSS for website
Remove the { } ... you do not need those
@mixin something
attribute: value
Scss (live scss compiler) throws an error when using the imported variables from another scss file (@use)
Use Live Sass Compiler by Glenn Marks
I had exactly the same problem. You read about @use
on SASS official website, follow the instructions, write the code in Visual Studio Code and then you get this strange Compilation Error
when saving the SASS or SCSS file. You double check everything and it seems like it should work but it doesn't.
Well, the problem is caused by the Visual Studio Code extension you are using for compiling SASS or SCSS files to CSS files.
Don't use this extension: Live Sass Compiler by Ritwick Dey
You are probably using this extension: Live Sass Compiler by Ritwick Dey.
It's widely used, but no longer supported by the author. Consequently, the SASS version isn't updated. This extension produces the error you are describing as you can see below.
Use this extension: Live Sass Compiler by Glenn Marks
You should use this extension: Live Sass Compiler by Glenn Marks. As the author states: A big thank you to @ritwickdey for all his work. However, as they are no longer maintaining the original work, I have released my own which has built upon it. This extension compiles your SASS or SCSS files to CSS files successfully as you can see below.
Compiling sass file Error: Expected spaces, was tabs.
Consistent indentation is a good code style. Especially if you mix spaces and tabs and share the files with other people, it could get wild.
An .editorconfig
file might help you, if your editor (and your coworkers editors) understand it
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.
Sass @mixin and @include compilation error
When including a mixin the :
is unnecessary and will cause an error.
Instead:
@mixin mixin-name() {...}
@include mixin-name();
Related Topics
CSS- Target Text Links with Bottom Border on Hover, But Image Links with No Border
Interruption of a CSS Transition Does Not Work for Same Attribute Value
How to Align Input and Label from Collection_Check_Boxes
Add Strikethrough to Checked Checkbox
Using an Image File Vs Data Uri in The CSS
Force Nested Divs to Have Min-Height of 100%
Ionic - How to Wordwrap a Long String in Ion-Header
Multilanguage Utf-8 Website with Arabic
How to Fade Out Sides of Images
Cumulative Layout Shift with Bootstrap 4 Grid
Where to Put CSS3 Media Queries
Prevent Highlighter Cursor in CSS
Roboto from Materializecss Weird Font Rendering in Chrome, Firefox, Ok with Ie
How to Give Class Name to Animation State in Angular 2/4
How to Set Different Font-Weight for Fallback Font
Which Framework Is Best for Starting with Responsive Web Design