Twitter bootstrap:我需要 bootstrap-sass 和 twitter-bootstrap-rails gems 吗?

2024-02-13

我的(Rails 3.2.13)Gemfile 有以下条目:

gem 'twitter-bootstrap-rails'
gem 'bootstrap-sass'

在 app/assets/javascripts/application.js 中:

//= require twitter/bootstrap

在 app/assets/stylesheets/custom.css.scss 的顶部:

@import 'bootstrap'

它是否正确”?我是否需要“twitter-bootstrap-rails”和“bootstrap-sass”(或者可能是“bootstrap-sass-rails”),或者它们是多余的并且可能存在冲突? “bootstrap-sass”gems 是否包含框架的 javascript,还是仅包含 CSS?


不,你不需要两者。

只需将其放入您的 gemfile 中即可:

gem 'sass-rails'
gem 'bootstrap-sass'

这在 application.css.scss 中:

@import 'bootstrap';
@import 'bootstrap-responsive';

这在 application.js 中

//= require bootstrap

如果您仍然遇到问题,您可能需要查看清单文件中的内容顺序。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Twitter bootstrap:我需要 bootstrap-sass 和 twitter-bootstrap-rails gems 吗? 的相关文章

随机推荐