SASS 语法错误:文档根目录不允许属性
我正在使用 SASS 并且它一直在工作,但现在我得到了这个...
Syntax error on line 1: Properties aren't allowed at the root of a document.
我的文件正在使用 SASS 格式的变量。
$blue-muted: #222244
$red-muted: #442222
$green-muted: #224422
当我删除变量(并将值替换为实际颜色)时,它可以正常编译。这里有什么问题吗?
编辑:我的困惑源于安装了 HAML 3.0,但行为与早期 2.0 版本一致。事实证明,我的路径中有一个旧版本的 SASS 命令行工具,并且它正在运行,而不是当前版本。
I am using SASS and it has been working, but now I get this...
Syntax error on line 1: Properties aren't allowed at the root of a document.
My file is using variables in the SASS format.
$blue-muted: #222244
$red-muted: #442222
$green-muted: #224422
When I remove the variables (and replace the values with the actual colors), it compiles fine. What is wrong here?
EDIT: My confusion stemmed from having installed HAML 3.0, but getting behavior consistent with an early 2.0 version. It turned out that I had a SASS command line tool from an old version in my path and it was running instead of the current version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在使用新的 SCSS 语法,应如下所示:
$blue-muted: #222244;
如果您想使用 sass,则颜色应声明为:
!blue-muted =#222244
Looks like you are using the new SCSS syntax which should look like:
$blue-muted: #222244;
if you want to use sass, the colors should be declared as:
!blue-muted = #222244