user2499088
user2499088

Reputation: 645

SASS Invalid css error

I just started with sass and installed prepros. I tried to compile an .scss file and got an error:

Syntax error: Invalid CSS after " color: ": expected expression (e.g. 1px, bold), was "@blue;"

The .scss code:

.footer {
clear: both;
background-color: @blue;

}

I installed Ruby, and prepros.

Upvotes: 1

Views: 2213

Answers (2)

KatieK
KatieK

Reputation: 13843

It looks like your syntax is wrong. In Sass, @ is for things like imports, media directives, partials (includes) and extends.

If you want to define a specific value for blue, and then reuse it, then the syntax is something like this:

$blue: #3333FF;

a {
    font-weight: bold;
    color: $blue;
}

Upvotes: 1

robertjlooby
robertjlooby

Reputation: 7220

SCSS uses $ to denote variables so it should be background-color: $blue;

Upvotes: 4

Related Questions