ruby-on-rails – 使用带有rails资产管道的twitter bootstrap
发布时间:2020-12-17 02:35:52 所属栏目:百科 来源:网络整理
导读:如何正确整合 twitter-bootstrap-rails宝石与资产管道? 我已经按照安装步骤进行操作,目前我有这个application.css *= require_self *= require bootstrap_and_overrides 然后在bootstrap_and_overrides.css.less中我导入其他控制器样式表,以使它们与我在覆
如何正确整合
twitter-bootstrap-rails宝石与资产管道?
我已经按照安装步骤进行操作,目前我有这个application.css *= require_self *= require bootstrap_and_overrides 然后在bootstrap_and_overrides.css.less中我导入其他控制器样式表,以使它们与我在覆盖文件中定义的变量一起使用,并且能够在< controller-name>中的控制器特定样式表中使用bootstrap mixins. css.less文件.目前我这样做: # 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与链轮一起工作? 解决方法
在github上思考
this问题解释了你的问题. (我知道这是为了sass,但无论如何解释应该是有效的)
简而言之,使用sprockets将单独编译每个文件,这意味着您不能使用由twitter bootstrap框架定义的变量和mixins.所以我猜答案是否定的:) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |