我正在尝试按照此处的文档创建基本的Compass扩展程序: http://compass-style.org/help/tutorials/extensions/
我看到的问题是我无法按预期从我的扩展程序导入文件,因为文档说的样式表目录将自动添加到加载路径中,而不是添加到加载路径
它给我一个命令行错误,说它无法找到我尝试导入的文件,然后列出加载路径,验证我的路径不在那里。
其中一个加载路径确实是/ Users / myname / Sites / sitename / myextension_name,但我希望还有/ Users / myname / Sites / sitename / myextension_name / 样式表
任何人都知道为什么这不会发生,如文档中所示?
更新 这是我的config.rb按要求:
add_import_path '../../myextension'
# Require any additional compass plugins here.
require "susy"
require "sass-media_query_combiner"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "../../js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :expanded #or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
答案 0 :(得分:0)
Ad hoc扩展需要放在extensions_dir
目录中(默认设置为extensions
)。
/path/to/config.rb
/path/to/sass/
/path/to/stylesheets/
/path/to/extensions/ <- extensions go here
您的myextension_name
扩展程序应位于/path/to/extensions/myextension_name/
中,然后按照其他约定创建扩展程序。您可以将extensions_dir
指定为与sass_dir
或项目根目录相同,但我不确定这是否是明智之举。
如果您的扩展程序要与其他项目一起使用,最好将其作为gem进行捆绑,并以与使用Susy相同的方式使用它。