如何在 Mac 上开始使用 Compass/Sass – 无效 CSS 错误?

发布于 2024-10-17 01:55:41 字数 682 浏览 2 评论 0原文

我正在尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九局 2024-10-24 01:55:41

正如@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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文