1

几个月前,我使用 Foundation 和 Sass & Compass 开始了一个项目。今天我意识到最近来自 Zurb 的人添加了一些新功能,所以我只是更新了我的 gem gem update zurb-foundation,虽然更新成功了,但我发现我的文件没有任何变化。

例如,在我的 _settings.scss 文件中,在 Orbit 部分,我的最后一部分如下:

// Slide numbers
// $orbit-slide-number-bg: rgb(0,0,0);
// $orbit-slide-number-font-color: #fff;
// $orbit-slide-number-padding: emCalc(5px);

// Margin for when Orbit is stacked on small screens
// $stack-on-small-margin-bottom: emCalc(20px); // Doesn't quite work yet

但是,如果您查看他们的Orbit Documentation,最后一部分是:

/* We use thes to controls the style of slide numbers */
$orbit-slide-number-bg: rgba(0,0,0,0);
$orbit-slide-number-font-color: #fff;
$orbit-slide-number-padding: emCalc(5px);

/* Graceful Loading Wrapper and preloader */
$wrapper-class: "slideshow-wrapper";
$preloader-class: "preloader";

所以我错过了关于加载包装器和预加载器的最后一部分。

我觉得我的项目实际上没有任何问题,只是我不明白更新应该如何工作,所以如果有人能解释一下,我将不胜感激。

4

1 回答 1

2

Ok I have found the answer so I'll leave it here in case it helps others.

The idea is that when you update your gem you are actually not updating your project but the Foundation "core" installed in your system (very roughly explained as I am quite ignorant of Ruby). Anyway, for updating your project you need to have your gem up to date first.

Now, for updating your project you need to follow the steps in Foundation Docs, where it says "Working with Existing projects", under the heading "Upgrading Foundation Compass projects".

First it's very important that you realise that updating could OVERWRITE your files and make you loose your changes, so read carefully and backup your project before anything.

You have two options:

1) updating only javascripts/image assets. These are file that you have probably not modified unless you are heavily customising the framework. For doing so you should navigate to your project's folder and run

compass install -r zurb-foundation foundation/upgrade --force

where --force is forcing the update to overwrite your old files.

2) upgrade Foundation as a whole. Read through the Foundation warning before doing this, basically they advise you to have your own stylesheet with the overrides on it so it doesn't get lost with the update. Again in your project's folder, run

compass install -r zurb-foundation foundation

Here you can also use --force at the end of the sentence.

So, to sum up, updating the foundation gem and updating your project are different things. You can update your gem without that affecting old projects. But to update an existing project you need to upgrade your gem first, then update the project being careful enough so the update doesn't override any changes you may have made.

于 2013-06-05T10:37:54.100 回答