使用指南针配置zurb Foundation-Sass-如何使其工作并在项目中使用它? [英] Configuring zurb foundation-sass with compass - how do you get it working and use it in a project?

查看:69
本文介绍了使用指南针配置zurb Foundation-Sass-如何使其工作并在项目中使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是sass和zurb基金会的新手(我过去使用过bootstrap / less通过codekit),并一直在尝试使用sass版本的 foundation-sass 但无法成功配置它-通过命令行使用zurb的gem或使用codekit。

I'm new to sass and zurb foundation (I've used bootstrap/less via codekit in the past) and have been trying to use the sass version foundation-sass but can't successfully get it configured - either via the command line using zurb's gem or by using codekit.

如果我配置了gem:


  1. 只要我通过 @import ZURB-foundation加载所有基础组件,基础就可以工作;

但是如果我尝试通过取消注释 @import zurb / buttons来分别加载组件; 我看到错误:未定义变量: $ default-color -但是变量和mixin文件在哪里?

But if I try to load components separately by uncommenting @import "zurb/buttons"; I see errors: "Undefined variable: "$default-color" - but where do the variables and mixin files live?

此外,基础scss文件位于何处,以便您可以自定义设计而不必使用apps.scss覆盖所有内容?

Also, where do the foundation scss files live so you can customize the design without having to override everything using apps.scss?

如果我选择另一条路线并尝试使用mac应用程序代码包:


  1. 我收到/ zurb /目录不存在(实际上不存在)的错误-这似乎与上面的第3点有关-创建新的罗盘基础项目时,没有基础文件似乎位于您的项目文件夹中。

如果我随后通过github下载Foundation-sass:


  1. 所有文件均为sass格式,而不是scss

  1. All the files are in sass format rather than scss

尽管您可以在调用罗盘混合器时对其进行修改,但是如何在不修改其原始样式的情况下修改基础的样式表文件?还是应该编辑其文件?

And although you can modify compass mixins as you call them, how do you modify foundation's stylesheet files without modifying their originals - or are you supposed to edit their files?

我还没有找到我所了解的有关一切应该如何融合的信息,所以希望有人可以知道。

I haven't found any information I understand on how everything is supposed to fit together so was hoping someone here might know.

我不是将其与ruby项目一起使用-只是试图纯粹为前端工作设置东西。

I'm not using this with a ruby project btw - just trying to set things up purely for front-end work.

任何帮助将不胜感激。

Any help would be much appreciated.

欢呼声

Ben

推荐答案

我希望您现在已经解决了这个问题。否则,这是宝石的解决方案。

I hope you've solved the problem by now. If not, here's a solution for the gem.

从Foundation 2.2.1开始,建议的导入顺序在 foundation.sass 通过注释行有点不对。 shared / * 中定义了许多颜色或混合,如果在加载这些之前加载 buttons / * ,您会

As of Foundation 2.2.1, the suggested import order found in foundation.sass, through commented lines, is somewhat wrong. Many colors or mixins are defined in shared/* and if you load buttons/* before loading these, you'll end up insulted by compass.

另一方面,部分 _ZURB-foundation.sass (由 @import ZURB-foundation )以正确的顺序加载部分,解释了为什么在单独加载组件时只出现错误。

On the other hand, the partial _ZURB-foundation.sass (imported by @import "ZURB-foundation") loads partials in the right order, explaining why you only got errors while loading components separately.

尝试以下顺序(SASS语法,为SCSS添加引号和分号):

Try this order (SASS syntax, add quotes and semicolons for SCSS):

@import zurb/shared
@import zurb/globals
@import zurb/typography
@import zurb/grid
@import zurb/buttons
@import zurb/ui
@import zurb/forms
@import zurb/orbit
@import zurb/reveal
@import zurb/mobile

您可以使用ZURB基金会的 gem 来查找存储gem的目录。不过,直接自定义Foundation文件并不是一个好主意,因为您的更改可能会被进一步的更新删除。

You can use gem which ZURB-foundation to find out which directory stores the gem. Customizing Foundation files directly is nevertheless a very bad idea, as your changes might be erased by further updates.

这篇关于使用指南针配置zurb Foundation-Sass-如何使其工作并在项目中使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆