【问题标题】:How to update SASS styles of Foundation 5?如何更新 Foundation 5 的 SASS 样式?
【发布时间】:2014-06-06 01:14:02
【问题描述】:

我是 Foundation 框架的新手,所以这是一个简单的新手问题。

在我的项目中,sass 目录中只有几个 scss 文件:

_foundation.scss (CSS file of 5000+ lines)
_normalize.scss (normalizing CSS file)
_setting.scss (A large amount of commented SCSS variables)
app.scss (Gathering the other scss files)

没有更多的 scss 文件代表不同的模块,我有点失望。

首先,我想更新一个样式值,例如顶栏背景颜色:

$topbar-bg-color: rgba(0,0,0,0);

我应该在哪里插入或更新这个值? 我尝试更新setting.scss,但没有成功。

【问题讨论】:

  • 愚蠢的问题,但是,您在编辑setting.scss后再次编译文件了吗?
  • 我认为它是自动化的;该目录由 Compass 监视。我设法通过更新 app.scss 来改变身体背景。所以我猜 Compass 监控正确......
  • 所以在所有其他文件都包含在那里之后去app.scss,因此 var 在后面的代码中被覆盖。
  • 很高兴知道。但是,它不会更新 app.css。刚刚发现了 compas_app_log,它说 app.css 样式表是相同的:(
  • 我想我知道发生了什么。我无法更新foundation.scss,因为它是一个静态CSS 文件。我在哪里可以下载 Foundation 5 的 scss 版本?

标签: css sass zurb-foundation compass-sass


【解决方案1】:

我发现我从静态 css 文件中手动添加了 _foundation.scss。所以无法更新...

解决办法就是删除这个静态的 _foundation.scss 文件。应该没有。我不知道 sass 从哪里导入基础样式。但重点是,在sass文件夹中没有_foundation.scss文件的情况下,基础样式实际上是导入更新的。

【讨论】:

  • 感谢@neciu。如果您需要查看 app.scss 文件,请查看他的答案。
【解决方案2】:

您应该使用 _settings.scss 文件。在 scss 目录中创建app.scss 文件并将其放入其中:

@import "normalize"; // just normal normalization
@import "foundation/settings"; // the CHANGED settings (will affect Foundation)
@import "foundation"; // and Foundation framework itself

// your awesome custom styles go here

然后编译app.scss - 就是这样。

【讨论】:

    猜你喜欢
    • 2013-12-31
    • 2013-12-09
    • 2014-05-31
    • 1970-01-01
    • 2013-12-12
    • 2014-02-05
    • 2015-09-20
    • 2017-03-10
    • 1970-01-01
    相关资源
    最近更新 更多