Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zurb foundation 如何使用罗盘和X2B的基础5;无礼?_Zurb Foundation_Compass Sass - Fatal编程技术网

Zurb foundation 如何使用罗盘和X2B的基础5;无礼?

Zurb foundation 如何使用罗盘和X2B的基础5;无礼?,zurb-foundation,compass-sass,Zurb Foundation,Compass Sass,问题 是上周发布的,这很好,但新版本需要用于与SASS一起使用F5,官方文档似乎有点不完整和不成熟 我正在尝试使用文档建议的步骤创建一个项目: [sudo] npm install -g bower 然后 gem install foundation 这里没问题。问题在于创建Compass项目时: foundation new MY_PROJECT cd MY_PROJECT compass compile 编译Compass后,我得到以下错误: directory stylesheets

问题

是上周发布的,这很好,但新版本需要用于与SASS一起使用F5,官方文档似乎有点不完整和不成熟

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

[sudo] npm install -g bower
然后

gem install foundation
这里没问题。问题在于创建Compass项目时:

foundation new MY_PROJECT
cd MY_PROJECT
compass compile
编译Compass后,我得到以下错误:

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
):

# 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"
@import "settings";
@import "foundation";
...
// Uncomment to use rem-calc() in your settings
@import "foundation/functions";
// Uncomment to use rem-calc() in your settings
@import "foundation/_functions";
SASS文件(
app.SASS
):

# 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"
@import "settings";
@import "foundation";
...
// Uncomment to use rem-calc() in your settings
@import "foundation/functions";
// Uncomment to use rem-calc() in your settings
@import "foundation/_functions";
问题似乎出现在
config.rb
中:

add_import_path "bower_components/foundation/scss"
因为Compass无法导入文件
设置
基础
,但我不知道如何修复它。我们将非常感谢您的帮助

谢谢。

您需要更改行
foundation new MY_PROJECT
,方法是将
MY_PROJECT
替换为要安装项目的文件夹。然后,确认这些文件夹存在于您上面指定的目录——“bower_components/foundation/scss”中

启动项目时运行
compass init
,然后运行
compass watch
(在终端中)以查看
.sass
文件上的更改


就我个人而言,我不会走这条路,用它来转换或“编译”我的Sass。这是免费的,很棒。

我想我也犯了同样的错误;最后,我在
\u settings.scss

在导入函数之前,需要加下划线

之前:

# 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"
@import "settings";
@import "foundation";
...
// Uncomment to use rem-calc() in your settings
@import "foundation/functions";
// Uncomment to use rem-calc() in your settings
@import "foundation/_functions";
之后:

# 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"
@import "settings";
@import "foundation";
...
// Uncomment to use rem-calc() in your settings
@import "foundation/functions";
// Uncomment to use rem-calc() in your settings
@import "foundation/_functions";
您还需要以相同的方式导入设置

在我的示例中,我制作了style.scss并导入其中的所有scs:

@import "foundation/_settings",  "_normalize", "_foundation";

app.sass
文件中,更改以下行

@import "settings";

解释 当您运行
指南针手表时
会出现错误

error scss/app.scss (Line 1: File to import not found or unreadable: settings.

这只是意味着它找不到正在导入的设置文件。通过向设置文件添加下划线,您已指定了正确的文件路径。如果您收到任何其他类似的错误,请确保文件路径正确。

我遇到了相同的问题,但对我来说,解决方案是将
app.scss
中的设置导入更改为:

@import“设置”

致:

@import“基础设置”


完成后,再次运行
compass watch

这就是我们谈论的SASS。如果我错了,请更正,但在导入“包含”文件时不需要下划线。我为变量和混合项创建单独的sass文件。它们的前缀为和下划线,表示“包含”文件。SASS识别@import“变量”;作为@import“\u variables.scss”。因此,要明确的是,当它是一个include文件时,sass文件的名称不需要u或scss扩展名

我从未将下划线放在我命名为_filename.scss的任何包含文件之前


可能还有另一个问题。可能与安装和bower的路径有关。对于那些在过去添加下划线的人来说,这样做很有效……好吧,你只是绕过了可能会成为更深层次问题的问题。您需要检查安装情况。

您可以将Grunt安装到您的项目中,该项目使用compass的watch功能,然后使用其他一些聪明的东西来编译您的sass并在浏览器中加载它!这里有一个关于如何启动和运行它的很棒的教程!(这很简单,只需在项目的根目录中创建两个新文件,然后从命令行运行几个命令!我郑重建议!)

我也有同样的问题。 对于Ubuntu 14.04用户,请确保nodejs和Bower工作正常。
您可以按照这里的说明操作

非常感谢Mike。我意识到这个问题与NodeJS和Bower有关。在我的Ubuntu中与它们存在版本冲突,并且Bower无法正常工作,因此缺少文件夹
Bower_components
,导入失败。我按照以下说明修复了重新安装NodeJs的问题:(也适用于Ubuntu 13.10)。谢谢我运行了罗盘,完成了一个新的基础工程。它应该是文档的一部分吗!?!确保安装了指南针。看见