【问题标题】:Foundation Icon Fonts via Bower基础图标字体来自 Bower
【发布时间】:2014-06-28 11:45:05
【问题描述】:

我刚刚通过 Bower 安装了 Foundation Icon Fonts,我想知道如何最好地将它们包含在我的 app.scss 文件中,同时保持 Bower 文件夹不变。以下是我尝试的设置和收到的错误。我知道我可以将文件放在我网站的 scss 文件夹或基础文件夹中,但没有理由使用 Bower。

我得到的错误是:

 error scss/app.scss (Line 13: File to import not found or unreadable: foundation-icon-fonts/_foundation-icons.scss.

bower_components 文件夹:

 > bower_components
 >> fastclick
 >> foundation
 >> foundation-icon-fonts
 >> ...other components

bower.json:

 {
    "name": "foundation-compass-app",
    "version": "0.0.1",
    "private": "true",
    "dependencies": {
        "foundation": "~5.2.2",
        "foundation-icon-fonts": "*"
    }
 }

config.rb:

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

 http_path = "/"
 css_dir = "stylesheets"
 sass_dir = "scss"
 images_dir = "images"
 javascripts_dir = "js"

 output_style = :compressed

【问题讨论】:

  • 如果 _foundation-icons.scss 在 bower_components/foundation-icon-fonts 内,那么你的导入路径是错误的。
  • 是的 但是为什么导入路径错误?
  • 通过说add_import_path "bower_components/foundation-icon-fonts",你是在告诉 Sass,“嘿,开始在这个目录中查找 Sass 文件”。通过说@import "foundation-icon-fonts/_foundation-icons.scss",完整的搜索路径最终是bower_components/foundation-icon-fonts/foundation-icon-fonts/_foundation-icons.scss,它不存在。

标签: sass zurb-foundation bower


【解决方案1】:

config.rb:

add_import_path "bower_components/foundation-icon-fonts"

app.scss:

$fi-path: "/bower_components/foundation-icon-fonts";
@import "foundation-icons";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-22
    • 2016-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多