`bootstrap-sass` is a Sass-powered version of [Bootstrap](http://github.com/twbs/bootstrap), ready to drop right into your Sass powered applications.
...
...
@@ -17,13 +21,13 @@ Please see the appropriate guide for your environment of choice:
In your Gemfile you need to add the `bootstrap-sass` gem, and ensure that the `sass-rails` gem is present - it is added to new Rails applications by default.
```ruby
gem'bootstrap-sass','~> 3.3.3'
gem'bootstrap-sass','~> 3.3.4'
gem'sass-rails','>= 3.2'
```
`bundle install` and restart your server to make the files available through the pipeline.
Import Bootstrap styles in `app/assets/stylesheets/application.css.scss`:
Import Bootstrap styles in `app/assets/stylesheets/application.scss`:
```scss
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
...
...
@@ -33,11 +37,11 @@ Import Bootstrap styles in `app/assets/stylesheets/application.css.scss`:
`bootstrap-sprockets` must be imported before `bootstrap` for the icon fonts to work.
Make sure the file has `.css.scss` extension (or `.css.sass` for Sass syntax). If you have just generated a new Rails app,
Make sure the file has `.scss` extension (or `.sass` for Sass syntax). If you have just generated a new Rails app,
it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so rename it:
Then, remove all the `//= require` and `//= require_tree` statements from the file. Instead, use `@import` to import Sass files.
...
...
@@ -51,6 +55,11 @@ Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
//= require bootstrap-sprockets
```
`bootstrap-sprockets` and `bootstrap`[should not both be included](https://github.com/twbs/bootstrap-sass/issues/829#issuecomment-75153827) in `application.js`.
`bootstrap-sprockets` provides individual Bootstrap Javascript files (`alert.js` or `dropdown.js`, for example), while
`bootstrap` provides a concatenated file containing all Bootstrap Javascripts.
#### Bower with Rails
When using [bootstrap-sass Bower package](#c-bower) instead of the gem in Rails, configure assets in `config/application.rb`:
`bootstrap-sass` version reflects the upstream version, with an additional number for Sass-specific changes.
Bootstrap for Sass version may differ from the upstream version in the last number, known as
[MINOR](http://semver.org/spec/v2.0.0.html). The minor version may be ahead of the corresponding upstream minor.
This happens when we need to release Sass-specific changes.
Before v3.3.2, Bootstrap for Sass version used to reflect the upstream version, with an additional number for
Sass-specific changes. This was changed due to Bower and npm compatibility issues.
The upstream versions vs the Bootstrap for Sass versions are:
| Upstream | Sass |
|---------:|--------:|
| 3.3.4 | 3.3.4 |
| 3.3.2 | 3.3.3 |
| <= 3.3.1 | 3.3.1.x |
Always refer to [CHANGELOG.md](/CHANGELOG.md) when upgrading.
...
...
@@ -295,7 +317,7 @@ To convert a specific branch or version, pass the branch name or the commit hash
The latest converter script is located [here][converter] and does the following:
* Converts upstream bootstrap LESS files to its matching SCSS file.
* Copies all upstream JavaScript into `assets/javascripts/bootstrap`, an Sprockets manifest at `assets/javascripts/bootstrap-sprockets.js`, and a concatenation at `assets/javascripts/bootstrap.js`.
* Copies all upstream JavaScript into `assets/javascripts/bootstrap`, a Sprockets manifest at `assets/javascripts/bootstrap-sprockets.js`, and a concatenation at `assets/javascripts/bootstrap.js`.
* Copies all upstream font files into `assets/fonts/bootstrap`.
* Sets `Bootstrap::BOOTSTRAP_SHA` in [version.rb][version] to the branch sha.
...
...
@@ -316,15 +338,15 @@ and a [significant number of other contributors][contrib].
## You're in good company
bootstrap-sass is used to build some awesome projects all over the web, including