Search code examples
ruby-on-railstwitter-bootstraptwitter-bootstrap-rails

How to edit twitter bootstrap files in rails?


I'm trying to find the twitter-bootstrap files in my rails app ('bootstrap-sass', '2.0.0'), as I need to make a change directly to the bootstrap-responsive.css file, however, I can't find it.

I have bootstrap up and running, but can't seem to find the bootstrap files. How do I locate the bootstrap-responsive.css file?

Thank you!


Solution

  • The bootstap-sass gem uses the Rails 3.2 asset pipeline to inject the necessary stylesheets into your app. The actual stylesheet files are located in the gem installation directory, not in your project itself.

    Depending on what you want to change, you can either:

    1. Copy the _bootstrap-responsive.scss file from the gem into your app/assets directory and edit it there.
    2. Customize the necessary Bootstrap variables before loading up Bootstrap in your application.scss file:

      $btnPrimaryBackground: #f00;
      @import "bootstrap";