【问题标题】:Scss Issue - Error is preventing me from seeing websiteScss 问题 - 错误阻止我查看网站
【发布时间】:2015-03-12 04:15:19
【问题描述】:

我在保存 index.html 文件时在控制台中收到以下错误:

错误 sass/_settings.scss(第 9 行:“...r-set defaults.: expected ":" 后的 CSS 无效,第 9 行为 "$base-font-size..." sass/app.scss 第 2 行的 sass/_settings.scss

刷新我的 index.html 页面时,我也收到此错误,并且所有样式都已损坏。我正在使用 Foundation 和 Compass。

以下是我的 _settings.scss 文件中的第 1 - 9 行:

//
// Foundation Variables
//

$top

// The default font-size is set to 100% of the browser style sheet (usually 16px)
// for compatibility with browser-based text zoom or user-set defaults.
$base-font-size: 100% !default;

// $base-line-height is 24px while $base-font-size is 16px
// $base-line-height: 150%;

// This is the default html and body font-size for the base em value.

有人可以帮忙吗?谢谢。

【问题讨论】:

  • // 在 scss 中是合法的 cmets 吗? (我自己从未使用过它)他们没有在 css 中发表评论,根据你所说的 - scss 编译器似乎不会将它们视为评论。或者您可能正在尝试使用未编译的 scss 作为 css 文件?

标签: html css sass zurb-foundation


【解决方案1】:

问题是您的 $top 变量。规则没有结尾;。所以,这是一个无效的语法问题。

$top: 1;

... 将解决您的问题。当然,您需要删除该变量,或者根据需要分配一个合适的值。

【讨论】:

    猜你喜欢
    • 2010-11-05
    • 1970-01-01
    • 1970-01-01
    • 2018-08-05
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多