SASS无效的css错误

我刚开始使用sass并安装了prepros。 我试图编译.scss文件并出错:

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

.scss代码:

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

}

我安装了Ruby和prepros。

SCSS使用$来表示变量,因此它应该是background-color: $blue;

看起来你的语法错了。 在Sass中, @用于诸如导入 , 媒体指令 , 部分 (包括)和扩展之类的东西 。

如果要为蓝色定义特定值,然后重用它,则语法如下:

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