使用 github 版本的 compass rails31 分支和 sass-rails:
gem "sass-rails", :git => "https://github.com/rails/sass-rails.git"
gem "compass", :git => "https://github.com/chriseppstein/compass.git", :branch => "rails31"
我创建了一个部分 (_base.css.scss),其中包含蓝图/重置和蓝图排版的导入。我还有一个 screen.css.scss 文件,其中包含我的基本部分。
当 rails 将它编译到 application.css 中时,我看到我的重置和排版 css 两次。
样式表/application.css.scss
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
样式表/partials/_base.css.scss
@import "blueprint/reset";
@import "blueprint/typography";
@include blueprint-typography;
样式表/部分/screen.css.scss
@import "partials/_base";
#container { @include container; }
我真的不明白这里发生了什么,以及开始使用 compass 和 rails 3.1 的正确配置是什么
非常感谢您的指导!