Twitter bootstrap: do I need both bootstrap-sass and twitter-bootstrap-rails gems?

后端 未结 2 1549
情深已故
情深已故 2021-02-09 13:42

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

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

and in app/assets/javascripts/ap

相关标签:
2条回答
  • 2021-02-09 14:00

    No you do not need both.

    Just simply put this in your gemfile:

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

    This in application.css.scss:

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

    This in application.js

    //= require bootstrap
    

    If you're still having problems you may need to look at the ordering of things in your manifest files..

    0 讨论(0)
  • 2021-02-09 14:19

    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.

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

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

    0 讨论(0)
提交回复
热议问题