使用 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的局部文件,其中包含blueprint/reset和blueprint-typography的导入。我还创建了一个名为screen.css.scss的文件,该文件包含我的基本局部文件。
当Rails将其编译为application.css时,我会看到我的重置和排版css出现了两次。
stylesheets/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 .
*/
stylesheets/partials/_base.css.scss
@import "blueprint/reset";
@import "blueprint/typography";
@include blueprint-typography;
stylesheets/partials/screen.css.scss
@import "partials/_base";
#container { @include container; }
我不太明白这里发生了什么,以及使用Rails 3.1开始使用Compass的正确配置是什么。
非常感谢您的指导!