错误“ \“ ... inear-gradient(\”之后的无效CSS:预期选择器为\“ {\”“,

时间:2019-10-29 18:43:55

标签: css npm sass compilation

尝试编译sass时出现以下错误:(找不到错误的语法:)

/* {
   "status": 1,
   "file": "C:/Users/faido/Desktop/Productivity/sass 
   css/project/sass/main.sass",
   "line": 36,
   "column": 9,
   "message": "Invalid CSS after \"...inear-gradient(\": expected selector, 
   was \"{\"",
   "formatted": "Error: Invalid CSS after \"...inear-gradient(\": expected 
   selector, was \"{\"\n        on line 36 of sass/main.sass\n>>         
   linear-gradient( {\n\n   --------^\n"
   }
*/

此代码:

.header 
    background-image: linear-gradient( 
        to right bottom, 
        rgba( $color-primary-light, 0.8 ), 
        rgba( $color-primary-dark, 0.8 )
    ),
    url(../img/hero.jpg)

任何帮助/见解都得到了高度认可

1 个答案:

答案 0 :(得分:0)

Sass的缩进语法unfortunately does not support multiline expressions

要解决此问题,您必须将所有内容放到一行:

print("1.text looks like 30% with 2.text)