Why is the following sass code giving me an error? - sass

(.sass)
div
background-color: cyan
Build error: Transform Sass on dart_gol|lib/forms_menu.sass threw
error: Invalid CSS after "...und-color: #333": expected "{", was ""
on line 6 of standard input
I have Sass installed:
sass --version
"Sass 3.4.22 (Selective Steve)"
I just began using the Sass transformer using pub. I got that error; then went back to --watch . (using Sass via terminal) to see if it happened there. The error was the same both times.
I'm using a .sass extension and it is giving me the problem. I'm using the Sass Basics as a guide.
I did not have a problem when using .scss, with the bracket formatting. I'm not sure why .sass has a problem.

The problem appears to be in the dart_sass_transformer. It isn't properly compiling the sass into css.
Turning off the transformer (removing it from the pubspec) and running sass via Terminal is working properly.
The code in question is just fine.

It tells you it was expecting {
What you need is:
div {
background-color: cyan
}

Related

Jekyll can't compile .sass files

Jekyll simply won't compile any of my .sass files when I run it with
bundle exec jekyll build,
but jekyll serve -l works just fine. It's really irritating, because my sass works in a development environment, but breaks if I upload it to Github pages.
The error:
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/styles.scss':
Invalid CSS after " 50px": expected "}", was ";" on line 3
jekyll 3.9.0 | Error: Invalid CSS after " 50px": expected "}", was ";" on line 3
assets/css/styles.scss:
---
---
#import "base";
_sass/base.sass:
\:root
--navheight: 50px;
--backgroundcolor: #1b111d
--textcolor: #F4F3EF
--navlink: #2478ed
I'm pretty sure base.sass on line 3 is where it's breaking, not styles.scss. Not sure why the error displays itself that way.
Ok, so turns out I just had to remove all the semicolons. That was pretty easy, I guess.

sass doesn't compile: Seg Fault error

i'm getting this error when i try to compile a scss file with:
sass test.scss test.css
the error in particulary is:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/util.rb:637: [BUG] Segmentation fault
I installed Ruby and Sass via gem. Reinstalling and creating an empty test.css didn't solve the problem.
this is the scss file:
$font-stack: Helvetica, sans-serif
$primary-color: #333
body
font: 100% $font-stack
color: $primary-color
Is there something I'm missing?
Make sure your extension is right! If you use the indented syntax, use .sass, otherwise use .scss. Fixing that lets it compile as expected for me.

SASS version mismatch between system and grunt-contrib-compass? [duplicate]

This question already has answers here:
Is Sass 3.3 compatible with Compass?
(3 answers)
Closed 7 years ago.
I've encountered the following issue with grunt-contrib-sass/compass:
(https://github.com/nex3/sass/issues/746)
Compiling this:
.badge {
border: 1px solid black;
&-info {
background:blue;
}
}
Errors this:
Sass Error: Invalid CSS after " &": expected "{", was "-info {"
"-info" may only be used at the beginning of a compound selector.
I have the latest SASS version (3.3.7) installed on the system (Ubuntu 12.04.4 LTS), and running scss from the command line on a fresh file with above code DO work.
However creating a fresh project with yo webapp (Yeoman generator-webapp), with Grunt, gives the above error.
Any thoughts?
As #cimmanon kindly commented, this is probably due to version conflict between SASS and Compass.
As Compass uses it's own version of SASS and I was using grunt-contrib-compass (and not SASS), and my version of Compass was < 1 - the effect was that the 3.3 version I had on my system wasn't used.
Watch out for that when using out-of-the-box Yeoman generators.
So when compiling this with 3.3.6 of SASS I get:
.badge {
border: 1px solid black;
}
.badge-info {
background: blue;
}
But with 3.2.19 I get the same error you do:
Invalid CSS after " &": expected "{", was "-info {"
"-info" may only be used at the beginning of a compound selector.
There's a rather involved history to using suffixes this way, see: A Change in Plans for Sass 3.3
So you have a SASS version problem somewhere in your toolchain.

Bourbon Neat is giving me error after sass watch

Hi guys i am new to Bourbon Neat.
ive installed bourbon and neat in a folder.
Now after i do this
sass --watch scss
When it compiles the css generated has following errors.
Syntax error: Invalid CSS after "... $grid-columns ": expected "}", was "!global !default;"
on line 48 of C:/neatFinale/scss/../neat/functions/_private.scss
from line 2 of C:/neatFinale/scss/../neat/_neat-helpers.scss
from line 6 of C:/neatFinale/scss/../neat/_neat.scss
from line 2 of C:/neatFinale/scss/main.scss
Please tell me if i am doing something wrong.
Thanks.
Ps: When doing Neat--ver it says DL is deprecated.

Use Map Data Type with Compass [duplicate]

This question already has answers here:
Is Sass 3.3 compatible with Compass?
(3 answers)
Closed 7 years ago.
I am using Compass with Sass (v 3.3 Maptastic Maple) and I am trying to use the new maps data structure. I am using grunt watch with compass, however when using the new maps syntax, it throws an error everytime I run grunt.
$colors: (
header: #b06,
text: #334,
footer: #666777
);
This is the error:
error sass/main.scss (Line 73 of sass/base/_variables.scss: Invalid CSS after " header": expected ")", was ": #b06,")
How can I use the new sass maps with compass?
I managed to get compass to compile the new syntax by installing the alpha of the latest version.
gem install compass --pre
Should do the trick.
I had the same issue with you, and after few hours of trying and googling, I found 2 solutions:
If you can, use grunt-contrib-sass instead.
But if you need to use grunt-contrib-compass, check the answer at this one Is Sass 3.3 compatible with Compass?

Resources