首页 文章

SASS无效的css错误

提问于
浏览
1

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

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

.scss代码:

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

}

我安装了Ruby和prepros .

2 回答

  • 4

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

  • 0

    看起来你的语法错了 . 在Sass中, @ 适用于importsmedia directivespartials(包含)和extends之类的内容 .

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

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

相关问题