bootstrap-sass 3.1.1.1 → 3.2.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bootstrap-sass might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +6 -2
- data/CHANGELOG.md +19 -0
- data/Gemfile +5 -10
- data/README.md +140 -75
- data/Rakefile +4 -5
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.svg +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/images/.keep +0 -0
- data/assets/javascripts/bootstrap-sprockets.js +12 -0
- data/assets/javascripts/bootstrap.js +2107 -0
- data/{vendor/assets → assets}/javascripts/bootstrap/affix.js +18 -11
- data/{vendor/assets → assets}/javascripts/bootstrap/alert.js +10 -6
- data/{vendor/assets → assets}/javascripts/bootstrap/button.js +11 -8
- data/{vendor/assets → assets}/javascripts/bootstrap/carousel.js +49 -31
- data/{vendor/assets → assets}/javascripts/bootstrap/collapse.js +19 -24
- data/{vendor/assets → assets}/javascripts/bootstrap/dropdown.js +9 -5
- data/{vendor/assets → assets}/javascripts/bootstrap/modal.js +25 -16
- data/{vendor/assets → assets}/javascripts/bootstrap/popover.js +9 -6
- data/{vendor/assets → assets}/javascripts/bootstrap/scrollspy.js +37 -21
- data/{vendor/assets → assets}/javascripts/bootstrap/tab.js +11 -8
- data/{vendor/assets → assets}/javascripts/bootstrap/tooltip.js +52 -17
- data/{vendor/assets → assets}/javascripts/bootstrap/transition.js +14 -3
- data/assets/stylesheets/_bootstrap-compass.scss +7 -0
- data/{vendor/assets → assets}/stylesheets/_bootstrap-mincer.scss +0 -0
- data/assets/stylesheets/_bootstrap-sprockets.scss +7 -0
- data/{vendor/assets/stylesheets/bootstrap.scss → assets/stylesheets/_bootstrap.scss} +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_alerts.scss +4 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/_badges.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_breadcrumbs.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_button-groups.scss +5 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_buttons.scss +0 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_carousel.scss +3 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_close.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_code.scss +6 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_component-animations.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_dropdowns.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_forms.scss +82 -22
- data/{vendor/assets → assets}/stylesheets/bootstrap/_glyphicons.scss +4 -4
- data/{vendor/assets → assets}/stylesheets/bootstrap/_grid.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_input-groups.scss +6 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_jumbotron.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_labels.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_list-group.scss +3 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_media.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_mixins.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_modals.scss +7 -4
- data/{vendor/assets → assets}/stylesheets/bootstrap/_navbar.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_navs.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_normalize.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_pager.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_pagination.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_panels.scss +6 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/_popovers.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_print.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_progress-bars.scss +18 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-embed.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-utilities.scss +2 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_scaffolding.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_tables.scss +2 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_theme.scss +11 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_thumbnails.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_tooltip.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_type.scss +16 -6
- data/{vendor/assets → assets}/stylesheets/bootstrap/_utilities.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_variables.scss +25 -20
- data/{vendor/assets → assets}/stylesheets/bootstrap/_wells.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_alerts.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_background-variant.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_border-radius.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_buttons.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_center-block.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_clearfix.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_forms.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -8
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid.scss +3 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_hide-text.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_image.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_labels.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_list-group.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_opacity.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_pagination.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_panels.scss +4 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_progress-bar.scss +2 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_size.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_table-row.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +5 -10
- data/bootstrap-sass.gemspec +11 -6
- data/bower.json +22 -90
- data/composer.json +1 -1
- data/lib/bootstrap-sass.rb +3 -2
- data/lib/bootstrap-sass/engine.rb +4 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/package.json +6 -1
- data/sache.json +5 -0
- data/tasks/bower.rake +6 -5
- data/tasks/converter.rb +3 -3
- data/tasks/converter/js_conversion.rb +11 -5
- data/tasks/converter/less_conversion.rb +30 -21
- data/tasks/converter/logger.rb +1 -0
- data/tasks/converter/network.rb +14 -16
- data/templates/project/{_variables.sass.erb → _bootstrap-variables.sass.erb} +0 -2
- data/templates/project/manifest.rb +17 -16
- data/templates/project/styles.sass +2 -2
- data/test/compass_test.rb +5 -4
- data/test/compilation_test.rb +10 -9
- data/test/dummy_node_mincer/manifest.js +2 -2
- data/test/dummy_rails/README.rdoc +1 -1
- data/test/dummy_rails/app/assets/javascripts/application.js +1 -1
- data/test/dummy_rails/app/assets/stylesheets/application.css.sass +2 -1
- data/test/dummy_rails/app/views/pages/root.html.slim +1 -1
- data/test/dummy_rails/config/application.rb +19 -3
- data/test/dummy_sass_only/compile.rb +4 -4
- data/test/gemfiles/sass_3_2.gemfile +1 -11
- data/test/gemfiles/sass_3_3.gemfile +2 -13
- data/test/gemfiles/sass_3_4.gemfile +7 -0
- data/test/gemfiles/sass_head.gemfile +2 -13
- data/test/node_mincer_test.rb +6 -5
- data/test/node_sass_test.rb +7 -6
- data/test/pages_test.rb +3 -3
- data/test/sass_test.rb +9 -6
- data/test/sprockets_rails_test.rb +11 -5
- data/test/support/dummy_rails_integration.rb +22 -0
- data/test/support/integration_test.rb +4 -11
- data/test/support/reporting.rb +17 -0
- data/test/test_helper.rb +22 -18
- data/test/test_helper_rails.rb +6 -0
- metadata +231 -151
- data/lib/bootstrap-sass/sass_functions.rb +0 -50
- data/vendor/assets/javascripts/bootstrap.js +0 -12
- data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6050eccd4daf64b5e5d72bca8ac1292f271cf035c73b3e5eff62f385816fa2f3
|
4
|
+
data.tar.gz: 387b67ca35856109dc25957a2eb2da470dc65a6cd53d5facdeb10d12c9f943d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41456d7bbd25cc93328e1ae7038636f54200fbc021b841fb52882226a527b5aa8da37a2311df2c189eb8c5e25c9c78f75fa475c664b4a7147f21f332081191aa
|
7
|
+
data.tar.gz: '0732993db77d14da653cf64d5d1cca86cb948c4337bda6ee9f256fbedcaf03f55fce53b5eedb0abcbc042ff443c9efccfb2fc88a0e0dad504f78f2fa366ce1d9'
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -3,13 +3,17 @@ rvm:
|
|
3
3
|
- 2.1.1
|
4
4
|
- 2.0.0
|
5
5
|
- jruby
|
6
|
-
- rbx
|
6
|
+
- rbx-2
|
7
7
|
gemfile:
|
8
8
|
- test/gemfiles/sass_3_2.gemfile
|
9
9
|
- test/gemfiles/sass_3_3.gemfile
|
10
10
|
- test/gemfiles/sass_head.gemfile
|
11
11
|
before_install:
|
12
|
-
- "npm install
|
12
|
+
- "npm install"
|
13
13
|
matrix:
|
14
14
|
allow_failures:
|
15
|
+
# rbx has issues https://github.com/rubinius/rubinius/issues/3060
|
16
|
+
- rvm: rbx-2
|
15
17
|
- gemfile: test/gemfiles/sass_head.gemfile
|
18
|
+
notifications:
|
19
|
+
slack: heybb:3n88HHilXn76ji9vV4gL819Y
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.2.0.2
|
4
|
+
|
5
|
+
Fixed a number of bugs. [Issues closed in v3.2.0.2](https://github.com/twbs/bootstrap-sass/issues?q=is%3Aissue+is%3Aclosed+milestone%3Av3.2.0.2).
|
6
|
+
|
7
|
+
## 3.2.0.1
|
8
|
+
|
9
|
+
Fixed a number of bugs: [Issues closed in v3.2.0.1](https://github.com/twbs/bootstrap-sass/issues?q=is%3Aissue+is%3Aclosed+milestone%3Av3.2.0.1).
|
10
|
+
|
11
|
+
## 3.2.0.0
|
12
|
+
|
13
|
+
- Assets (Sass, JS, fonts) moved from `vendor/assets` to `assets`. `bootstrap.js` now contains concatenated JS.
|
14
|
+
- Compass generator now copies JS and fonts, and provides a better default `styles.sass`.
|
15
|
+
- Compass, Sprockets, and Mincer asset path helpers are now provided in pure Sass: `bootstrap-compass`, `bootstrap-sprockets`, and `bootstrap-mincer`.
|
16
|
+
Asset path helpers must be imported before `bootstrap`, more in Readme.
|
17
|
+
- Sprockets / Mincer JS manifest has been moved to `bootstrap-sprockets.js`.
|
18
|
+
It can be required without adding Bootstrap JS directory to load path, as it now uses relative paths.
|
19
|
+
- Sprockets: `depend_on_asset` (`glyphicons.scss`) has been changed to `depend_on` to work around an issue with `depend_on_asset`.
|
20
|
+
[More information](https://github.com/twbs/bootstrap-sass/issues/592#issuecomment-46570286).
|
21
|
+
|
3
22
|
## 3.1.1.0
|
4
23
|
|
5
24
|
- Updated Bower docs
|
data/Gemfile
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
gem 'json', '>= 1.8.1'
|
8
|
-
gem 'rubysl-test-unit', '~> 2.0'
|
9
|
-
gem 'racc'
|
10
|
-
end
|
5
|
+
# Compass for the dummy app
|
6
|
+
gem 'compass', require: false
|
11
7
|
|
12
|
-
|
13
|
-
gem '
|
8
|
+
group :development do
|
9
|
+
gem 'byebug', platform: :mri_21, require: false
|
14
10
|
end
|
15
|
-
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Bootstrap for Sass [![Build Status](http://img.shields.io/travis/twbs/bootstrap-sass.svg)](http://travis-ci.org/twbs/bootstrap-sass)
|
1
|
+
# Bootstrap for Sass [![Gem Version](https://badge.fury.io/rb/bootstrap-sass.svg)](http://badge.fury.io/rb/bootstrap-sass) [![Bower Version](https://badge.fury.io/bo/bootstrap-sass-official.svg)](http://badge.fury.io/bo/bootstrap-sass-official) [![Build Status](http://img.shields.io/travis/twbs/bootstrap-sass.svg)](http://travis-ci.org/twbs/bootstrap-sass)
|
2
2
|
|
3
3
|
`bootstrap-sass` is a Sass-powered version of [Bootstrap](http://github.com/twbs/bootstrap), ready to drop right into your Sass powered applications.
|
4
4
|
|
@@ -6,6 +6,10 @@
|
|
6
6
|
|
7
7
|
Please see the appropriate guide for your environment of choice:
|
8
8
|
|
9
|
+
* [Ruby on Rails](#a-ruby-on-rails).
|
10
|
+
* [Compass](#b-compass-without-rails) not on Rails.
|
11
|
+
* [Bower](#c-bower).
|
12
|
+
|
9
13
|
### a. Ruby on Rails
|
10
14
|
|
11
15
|
`bootstrap-sass` is easy to drop into Rails with the asset pipeline.
|
@@ -13,18 +17,66 @@ Please see the appropriate guide for your environment of choice:
|
|
13
17
|
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.
|
14
18
|
|
15
19
|
```ruby
|
20
|
+
gem 'bootstrap-sass', '~> 3.2.0'
|
16
21
|
gem 'sass-rails', '>= 3.2'
|
17
|
-
|
22
|
+
```
|
23
|
+
|
24
|
+
It is also recommended to use [Autoprefixer](https://github.com/ai/autoprefixer-rails) with Bootstrap
|
25
|
+
to add browser vendor prefixes automatically. Simply add the gem:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
gem 'autoprefixer-rails'
|
18
29
|
```
|
19
30
|
|
20
31
|
`bundle install` and restart your server to make the files available through the pipeline.
|
21
32
|
|
33
|
+
Import Bootstrap styles in `app/assets/stylesheets/application.css.scss`:
|
34
|
+
|
35
|
+
```scss
|
36
|
+
@import "bootstrap-sprockets";
|
37
|
+
@import "bootstrap";
|
38
|
+
```
|
39
|
+
|
40
|
+
Make sure the file has `.css.scss` extension (or `.css.sass` for Sass syntax). If you have just generated a new Rails app,
|
41
|
+
it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it:
|
42
|
+
|
43
|
+
```console
|
44
|
+
$ rm app/assets/stylesheets/application.css
|
45
|
+
```
|
46
|
+
|
47
|
+
Do not use `//= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.
|
48
|
+
|
49
|
+
Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
|
50
|
+
|
51
|
+
```js
|
52
|
+
//= require jquery
|
53
|
+
//= require bootstrap-sprockets
|
54
|
+
```
|
55
|
+
|
56
|
+
#### Bower with Rails
|
57
|
+
|
58
|
+
When using [bootstrap-sass Bower package](#c-bower) in Rails, ensure [minimum Sass number precision](#sass-number-precision):
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
# e.g. config/initializers/sass.rb
|
62
|
+
::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
|
63
|
+
```
|
64
|
+
|
65
|
+
`bootstrap-sprockets` must be imported before `bootstrap` for the icon fonts to work.
|
22
66
|
|
23
67
|
#### Rails 3.2.x
|
24
68
|
|
25
|
-
|
26
|
-
|
27
|
-
|
69
|
+
Rails 3.2 is [no longer maintained for bugfixes](http://guides.rubyonrails.org/maintenance_policy.html), and you should upgrade as soon as possible.
|
70
|
+
|
71
|
+
Starting with bootstrap-sass v3.1.1.1, due to the structural changes from upstream you will need these
|
72
|
+
backported asset pipeline gems on Rails 3.2. There is more on why this is necessary in
|
73
|
+
https://github.com/twbs/bootstrap-sass/issues/523 and https://github.com/twbs/bootstrap-sass/issues/578.
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
gem 'sprockets-rails', '=2.0.0.backport1'
|
77
|
+
gem 'sprockets', '=2.2.2.backport2'
|
78
|
+
gem 'sass-rails', github: 'guilleiguaran/sass-rails', branch: 'backport'
|
79
|
+
```
|
28
80
|
|
29
81
|
### b. Compass without Rails
|
30
82
|
|
@@ -41,52 +93,49 @@ require 'bootstrap-sass'
|
|
41
93
|
```
|
42
94
|
|
43
95
|
```console
|
44
|
-
bundle exec compass install bootstrap
|
96
|
+
$ bundle exec compass install bootstrap
|
45
97
|
```
|
46
98
|
|
47
99
|
If you are creating a new Compass project, you can generate it with bootstrap-sass support:
|
48
100
|
|
49
101
|
```console
|
50
|
-
bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
|
102
|
+
$ bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
|
51
103
|
```
|
52
104
|
|
53
105
|
or, alternatively, if you're not using a Gemfile for your dependencies:
|
54
106
|
|
55
107
|
```console
|
56
|
-
compass create my-new-project -r bootstrap-sass --using bootstrap
|
108
|
+
$ compass create my-new-project -r bootstrap-sass --using bootstrap
|
57
109
|
```
|
58
110
|
|
59
111
|
This will create a new Compass project with the following files in it:
|
60
112
|
|
61
|
-
* [
|
62
|
-
* [
|
113
|
+
* [styles.sass](/templates/project/styles.sass) - main project Sass file, imports Bootstrap and variables.
|
114
|
+
* [_bootstrap-variables.sass](/templates/project/_bootstrap-variables.sass.erb) - all of Bootstrap variables, override them here.
|
63
115
|
|
64
116
|
Some bootstrap-sass mixins may conflict with the Compass ones.
|
65
117
|
If this happens, change the import order so that Compass mixins are loaded later.
|
66
118
|
|
67
|
-
### c.
|
68
|
-
|
69
|
-
Require the gem, and load paths and Sass helpers will be configured automatically:
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
require 'bootstrap-sass'
|
73
|
-
```
|
74
|
-
|
75
|
-
### d. Node.js / Bower
|
119
|
+
### c. Bower
|
76
120
|
|
77
121
|
Using bootstrap-sass as a Bower package is still being tested. It is compatible with node-sass 0.8.3+. You can install it with:
|
78
122
|
|
79
|
-
```
|
80
|
-
bower install bootstrap-sass-official
|
123
|
+
```console
|
124
|
+
$ bower install bootstrap-sass-official
|
81
125
|
```
|
82
126
|
|
83
127
|
`bootstrap-sass` is taken so make sure you use the command above.
|
84
128
|
|
85
|
-
Sass, JS, and all other assets are located at [
|
129
|
+
Sass, JS, and all other assets are located at [assets](/assets).
|
130
|
+
|
131
|
+
By default, `bower.json` main field list only the main `bootstrap.scss` and all the static assets (fonts and JS).
|
132
|
+
This is compatible by default with asset managers such as [wiredep](https://github.com/taptapship/wiredep).
|
86
133
|
|
87
|
-
#### Mincer
|
134
|
+
#### Node.js Mincer
|
88
135
|
|
89
|
-
If you use [mincer][mincer] with node-sass, import bootstrap into
|
136
|
+
If you use [mincer][mincer] with node-sass, import bootstrap into like so:
|
137
|
+
|
138
|
+
In `application.css.ejs.scss` (NB **.css.ejs.css**):
|
90
139
|
|
91
140
|
```scss
|
92
141
|
// Import mincer asset paths helper integration
|
@@ -94,47 +143,95 @@ If you use [mincer][mincer] with node-sass, import bootstrap into a `.css.ejs.sc
|
|
94
143
|
@import "bootstrap";
|
95
144
|
```
|
96
145
|
|
146
|
+
In `application.js`:
|
147
|
+
|
148
|
+
```js
|
149
|
+
//= require bootstrap-sprockets
|
150
|
+
```
|
151
|
+
|
97
152
|
See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for mincer.
|
98
153
|
|
99
|
-
|
154
|
+
|
155
|
+
### Configuration
|
156
|
+
|
157
|
+
#### Sass
|
158
|
+
|
159
|
+
By default all of Bootstrap is imported.
|
160
|
+
|
161
|
+
You can also import components explicitly. To start with a full list of modules copy
|
162
|
+
[`bootstrap.scss`](assets/stylesheets/bootstrap.scss) file into your assets as `bootstrap-custom.scss`.
|
163
|
+
Then comment out components you do not want from `bootstrap-custom`.
|
164
|
+
In the application Sass file, replace `@import 'bootstrap'` with:
|
165
|
+
|
166
|
+
```scss
|
167
|
+
@import 'bootstrap-custom';
|
168
|
+
```
|
169
|
+
|
170
|
+
#### Sass: Number Precision
|
100
171
|
|
101
172
|
bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 10 (default is 5).
|
102
173
|
|
103
|
-
|
174
|
+
Precision is set for Rails and Compass automatically.
|
175
|
+
When using ruby Sass compiler standalone or with the Bower version you can set it with:
|
104
176
|
|
105
177
|
```ruby
|
106
178
|
::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
|
107
179
|
```
|
108
180
|
|
109
|
-
|
181
|
+
Note that libsass and node-sass do not currently support the precision option, due to an open bug ([bug #364](https://github.com/sass/libsass/issues/364)) in libsass.
|
182
|
+
|
183
|
+
|
184
|
+
#### Sass: Autoprefixer
|
185
|
+
|
186
|
+
Using [Autoprefixer][autoprefixer] with Bootstrap is recommended.
|
187
|
+
[Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from [Can I Use](http://caniuse.com/).
|
188
|
+
|
189
|
+
#### JavaScript
|
190
|
+
|
191
|
+
[`assets/javascripts/bootstrap.js`](/assets/javascripts/bootstrap.js) contains all of Bootstrap JavaScript,
|
192
|
+
concatenated in the [correct order](/assets/javascripts/bootstrap-sprockets.js).
|
193
|
+
|
194
|
+
|
195
|
+
#### JavaScript with Sprockets or Mincer
|
196
|
+
|
197
|
+
If you use Sprockets or Mincer, you can require `bootstrap-sprockets` instead to load the individual modules:
|
198
|
+
|
199
|
+
```js
|
200
|
+
// Load all Bootstrap JavaScript
|
201
|
+
//= require bootstrap-sprockets
|
202
|
+
```
|
203
|
+
|
204
|
+
You can also load individual modules, provided you also require any dependencies.
|
205
|
+
You can check dependencies in the [Bootstrap JS documentation][jsdocs].
|
110
206
|
|
111
|
-
|
207
|
+
```js
|
208
|
+
//= require bootstrap/scrollspy
|
209
|
+
//= require bootstrap/modal
|
210
|
+
//= require bootstrap/dropdown
|
211
|
+
```
|
112
212
|
|
113
|
-
|
213
|
+
#### Fonts
|
114
214
|
|
115
|
-
|
215
|
+
The fonts are referenced as:
|
116
216
|
|
117
|
-
```
|
217
|
+
```scss
|
118
218
|
"#{$icon-font-path}#{$icon-font-name}.eot"
|
119
219
|
```
|
120
220
|
|
121
|
-
`$icon-font-path` defaults to `bootstrap
|
221
|
+
`$icon-font-path` defaults to `bootstrap/` if asset path helpers are used, and `../fonts/bootstrap/` otherwise.
|
122
222
|
|
123
|
-
When
|
223
|
+
When using bootstrap-sass with Compass, Sprockets, or Mincer, you **must** import the relevant path helpers before Bootstrap itself, for example:
|
124
224
|
|
125
|
-
```
|
126
|
-
|
127
|
-
|
128
|
-
mkdir public/javascripts
|
129
|
-
cp -r $(bundle show bootstrap-sass)/vendor/assets/javascripts/ public/javascripts/
|
225
|
+
```scss
|
226
|
+
@import "bootstrap-compass";
|
227
|
+
@import "bootstrap";
|
130
228
|
```
|
131
229
|
|
132
230
|
## Usage
|
133
231
|
|
134
232
|
### Sass
|
135
233
|
|
136
|
-
Import Bootstrap into a Sass file (for example,
|
137
|
-
We recommend against using `//= require` directives, since none of your other stylesheets will be [able to access][antirequire] the Bootstrap mixins or variables.
|
234
|
+
Import Bootstrap into a Sass file (for example, application.css.scss) to get all of Bootstrap's styles, mixins and variables!
|
138
235
|
|
139
236
|
```scss
|
140
237
|
@import "bootstrap";
|
@@ -156,38 +253,6 @@ $navbar-default-color: $light-orange;
|
|
156
253
|
@import "bootstrap";
|
157
254
|
```
|
158
255
|
|
159
|
-
You can also import components explicitly. To start with a full list of modules copy this file from the gem:
|
160
|
-
|
161
|
-
```bash
|
162
|
-
cp $(bundle show bootstrap-sass)/vendor/assets/stylesheets/bootstrap.scss \
|
163
|
-
app/assets/stylesheets/bootstrap-custom.scss
|
164
|
-
```
|
165
|
-
Comment out components you do not want from `bootstrap-custom`.
|
166
|
-
|
167
|
-
In `application.sass`, replace `@import 'bootstrap'` with:
|
168
|
-
|
169
|
-
```scss
|
170
|
-
@import 'bootstrap-custom';
|
171
|
-
```
|
172
|
-
|
173
|
-
### Javascript
|
174
|
-
|
175
|
-
We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately),
|
176
|
-
put this in your Javascript manifest (usually in `application.js`) to load the files in the [correct order](/vendor/assets/javascripts/bootstrap.js):
|
177
|
-
|
178
|
-
```js
|
179
|
-
// Loads all Bootstrap javascripts
|
180
|
-
//= require bootstrap
|
181
|
-
```
|
182
|
-
|
183
|
-
You can also load individual modules, provided you also require any dependencies. You can check dependencies in the [Bootstrap JS documentation][jsdocs].
|
184
|
-
|
185
|
-
```js
|
186
|
-
//= require bootstrap/scrollspy
|
187
|
-
//= require bootstrap/modal
|
188
|
-
//= require bootstrap/dropdown
|
189
|
-
```
|
190
|
-
|
191
256
|
---
|
192
257
|
|
193
258
|
## Development and Contributing
|
@@ -214,9 +279,8 @@ To convert a specific branch or version, pass the branch name or the commit hash
|
|
214
279
|
The latest converter script is located [here][converter] and does the following:
|
215
280
|
|
216
281
|
* Converts upstream bootstrap LESS files to its matching SCSS file.
|
217
|
-
* Copies all upstream JavaScript into `
|
218
|
-
*
|
219
|
-
* Copies all upstream font files into `vendor/assets/fonts/bootstrap`
|
282
|
+
* 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`.
|
283
|
+
* Copies all upstream font files into `assets/fonts/bootstrap`.
|
220
284
|
* Sets `Bootstrap::BOOTSTRAP_SHA` in [version.rb][version] to the branch sha.
|
221
285
|
|
222
286
|
This converter fully converts original LESS to SCSS. Conversion is automatic but requires instructions for certain transformations (see converter output).
|
@@ -247,3 +311,4 @@ Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://g
|
|
247
311
|
[jsdocs]: http://getbootstrap.com/javascript/#transitions
|
248
312
|
[sass-precision]: http://sass-lang.com/documentation/Sass/Script/Number.html#precision-class_method
|
249
313
|
[mincer]: https://github.com/nodeca/mincer
|
314
|
+
[autoprefixer]: https://github.com/ai/autoprefixer
|
data/Rakefile
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
lib_path = File.join(File.dirname(__FILE__), 'lib')
|
2
|
+
$:.unshift(lib_path) unless $:.include?(lib_path)
|
3
|
+
|
1
4
|
load './tasks/bower.rake'
|
2
5
|
|
3
6
|
require 'rake/testtask'
|
@@ -10,7 +13,6 @@ end
|
|
10
13
|
desc 'Dumps output to a CSS file for testing'
|
11
14
|
task :debug do
|
12
15
|
require 'sass'
|
13
|
-
require './lib/bootstrap-sass/sass_functions'
|
14
16
|
path = Bootstrap.stylesheets_path
|
15
17
|
%w(bootstrap).each do |file|
|
16
18
|
engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
|
@@ -32,13 +34,10 @@ end
|
|
32
34
|
|
33
35
|
desc 'Compile bootstrap-sass to tmp/ (or first arg)'
|
34
36
|
task :compile, :css_path do |t, args|
|
35
|
-
lib_path = File.join(File.dirname(__FILE__), 'lib')
|
36
|
-
$:.unshift(lib_path) unless $:.include?(lib_path)
|
37
37
|
require 'sass'
|
38
|
-
require 'bootstrap-sass/sass_functions'
|
39
38
|
require 'term/ansicolor'
|
40
39
|
|
41
|
-
path = '
|
40
|
+
path = 'assets/stylesheets'
|
42
41
|
css_path = args.with_defaults(css_path: 'tmp')[:css_path]
|
43
42
|
puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
|
44
43
|
Dir.mkdir(css_path) unless File.directory?(css_path)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/assets/images/.keep
ADDED
File without changes
|