如何在 Mac 上开始使用 Compass/Sass – 无效 CSS 错误?
我正在尝试在 Mac 上开始使用 Compass/Sass。运行 sudo gem install compass 后,我设置了一个包含单个 main.scss 文件的项目,并使用 compass watch 来获取该文件自动编译为 CSS。
main.scss
看起来像这样:
@import "compass/css3/border-radius"
div .blah .baz {
@include border-radius(4px, 4px);
font-weight: bold;
}
看起来没什么复杂的,对吧?好吧,每次保存文件时,我都会收到这样的错误:
>>> Change detected to: /Users/mikl/Sites/ddk7/profiles/blaahval/themes/kaskelot/./scss/main.scss
error ./scss/main.scss (Line 3: Invalid CSS after ".../border-radius"": expected selector or at-rule, was "$blue: #3bbfce;")
overwrite ./css/main.css
我的 SCSS 语法是否有问题,或者只是指南针的错误消息非常糟糕?
I am trying to get started with Compass/Sass on my Mac. After running sudo gem install compass
, I have set up a project with a single main.scss
file and I use compass watch
to have the file automatically compiled to CSS.
main.scss
looks like this:
@import "compass/css3/border-radius"
div .blah .baz {
@include border-radius(4px, 4px);
font-weight: bold;
}
Seems like nothing complicated, right? Well, every time I save the file, I get an error like this:
>>> Change detected to: /Users/mikl/Sites/ddk7/profiles/blaahval/themes/kaskelot/./scss/main.scss
error ./scss/main.scss (Line 3: Invalid CSS after ".../border-radius"": expected selector or at-rule, was "$blue: #3bbfce;")
overwrite ./css/main.css
Is there something wrong with my SCSS syntax, or just compass just have very poor error messages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@jnpcl 所说,分号会很好。但是,如果这是问题所在,它应该抛出与此直接相关的错误。
这看起来有点夸张,但是您复制并粘贴了该行吗?或许性格有些奇怪?
As @jnpcl said, a semi-colon would be good. However, if that was the issue it should throw an error directly related to that.
This seems like a stretch, but did you copy and paste that line? Perhaps there is character weirdness happening?