如何在Compass + SASS中使用Foundation 5? [英] How to use Foundation 5 with Compass+SASS?

查看:69
本文介绍了如何在Compass + SASS中使用Foundation 5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

基金会5 上周发布了,很棒,但是新版本要求使用 bower 来将F5与SASS结合使用而且官方文档似乎有点不完整和不成熟。

Foundation 5 was released last week, that's great, but the new version requires to use bower for using F5 with SASS and the official documentation seems to be a bit incomplete and immature.

我正在尝试使用文档建议的步骤创建一个项目:

I'm trying to create a project using the steps proposed by the docs:

[sudo] npm install -g bower

然后

gem install foundation

没问题问题是在创建Compass项目时:

No problems here. The problem is when creating a Compass project:

foundation new MY_PROJECT
cd MY_PROJECT
compass compile

指南针编译后,出现以下错误:

After Compass compilation, I get the following error:

directory stylesheets/ 
    error scss/app.scss (Line 1: File to import not found or unreadable: settings.
Load paths:
  /home/cartucho/MY_PROJECT/scss
  /var/lib/gems/1.9.1/gems/compass-0.12.2/frameworks/blueprint/stylesheets
  /var/lib/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets
  /home/cartucho/MY_PROJECT/bower_components/foundation/scss
  Compass::SpriteImporter)
   create stylesheets/app.css 

指南针配置文件( config.rb ):

Compass config file (config.rb):

# Require any additional compass plugins here.
add_import_path "bower_components/foundation/scss"

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascripts"

SASS文件( app.sass ):

The SASS file (app.sass):

@import "settings";
@import "foundation";
...

问题似乎出在配置中。 rb

add_import_path "bower_components/foundation/scss"

因为Compass尝试导入文件设置 foundation失败,但我不知道如何解决。

because Compass fail trying to import the files settings and foundation but I don't know how to fix it. Any help will be highly appreciated.

谢谢。

推荐答案

您需要通过替换 MY_PROJECT 基础新的MY_PROJECT >与要在其中安装项目的文件夹。之后,确认这些文件夹在您上面指定的目录中存在- bower_components / foundation / scss

You need to change the line foundation new MY_PROJECT by replacing MY_PROJECT with the folder you want to install the project on. After that, confirm that these folders exist on the directory you specified above - "bower_components/foundation/scss"

开始项目时 > 运行 compass初始化,然后运行 compass监视(在终端机中)以监视 .sass 文件。

When starting a project run compass init and then compass watch (in Terminal) to watch for changes on the .sass files.

个人,我不走那条路线,而是使用 http://koala-app.com/ 来转换或编译我的Sass。它是免费的而且很棒。

Personally, I don't go that route and use http://koala-app.com/ to convert or "compile" my Sass. It's FREE and awesome.

这篇关于如何在Compass + SASS中使用Foundation 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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