Twitter bootstrap:我需要 bootstrap-sass 和 twitter-bootstrap-rails gems 吗? [英] Twitter bootstrap: do I need both bootstrap-sass and twitter-bootstrap-rails gems?

查看:51
本文介绍了Twitter bootstrap:我需要 bootstrap-sass 和 twitter-bootstrap-rails gems 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have the following entries my (Rails 3.2.13) Gemfile:

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

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

and in app/assets/javascripts/application.js:

//= require twitter/bootstrap

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

and at the top of app/assets/stylesheets/custom.css.scss:

@import 'bootstrap'

这是正确的"吗?我是否需要 'twitter-bootstrap-rails' 和 'bootstrap-sass'(或者可能是 'bootstrap-sass-rails'),或者它们是多余的并且可能发生冲突?'bootstrap-sass' gem 是包含框架的 javascript,还是只包含 CSS?

Is this "correct"? Do I need both 'twitter-bootstrap-rails' and 'bootstrap-sass' (or maybe 'bootstrap-sass-rails'), or are they redundant and possibly conflicting? Do the 'bootstrap-sass' gems include the javascript for the framework, or only the CSS?

推荐答案

如果你想使用 SASS 你应该使用 boostrap-sassbootstrap-sass-rails.Twitter-bootstrap-rails 使用 LESS 源.如果您同时包含两者,则可能会发生冲突.所有这些都已经包含用于引导程序的 javascript 并集成到资产管道中.

If you want to use SASS you should use boostrap-sass or bootstrap-sass-rails. Twitter-bootstrap-rails uses LESS source. If you were to include both there would probably be conflicts. All of them include javascript for bootstrap already and integrate into the asset pipeline.

我个人使用 LESS 版本,因为它是引导程序最初编写的.(引导程序更新时可能会获得更快的发布)

I personally use LESS version as it is what bootstrap is originally written in. (might get faster releases when bootstrap updates)

在 github 上查看 gems 以评估您的确切需求以及它们支持的 Rails 版本通常很好.

It's generally good to check the gems out on github to evaluate your exact needs and which version of Rails they support.

这篇关于Twitter bootstrap:我需要 bootstrap-sass 和 twitter-bootstrap-rails gems 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆