如何正确地将twitter-bootstrap-rails宝石与资源管道集成?
我已经按照安装步骤进行了操作,目前我的应用程序.css文件如下:
*= require_self
*= require bootstrap_and_overrides
然后在bootstrap_and_overrides.css.less文件中,我正在导入其他控制器样式表,以便它们可以与我在覆盖文件中定义的变量一起使用,并且可以在<controller-name>.css.less
文件中使用bootstrap mixins来实现特定于控制器的样式。目前我是这样做的:
# in bootstrap_and_overrides.css.less
// generated code ...
// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
//
// Example:
// @linkColor: #ff0000;
@linkColor: #ff0000;
// import all other stylesheets
@import 'home.css.less';
@import 'users.css.less';
// and so on, once for every controller
// in home.css.less
#foobar {
.border-radius(30px); // bootstrap mixin
color: @linkColor; // inherited variable
}
然而这种方法会导致我失去资产管道,并且在开发模式下无法看到单个样式表。有没有办法让twitter-bootstrap-rails与sprockets兼容?