Configuring zurb foundation-sass with compass - how do you get it working and use it in a project?

最后都变了- 提交于 2019-12-03 20:38:26

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

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.

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.

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

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.

For Zurb Foundation 4 it is as simple as importing the "/foundation/foundation-global" file first

@import 'foundation/foundation-global';
@import 'foundation/components/type';
// etc

See here in the source comments

It's important to note that 'foundation/global' is not the same thing as 'foundation-global'. The later just satisfies basic dependencies, while the former provides some minimal basic styling.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!