bootstrap-sass 3.3.1.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +8 -14
- data/CHANGELOG.md +55 -0
- data/CONTRIBUTING.md +8 -1
- data/Gemfile +1 -4
- data/LICENSE +2 -1
- data/README.md +118 -96
- data/Rakefile +58 -12
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/assets/javascripts/bootstrap/affix.js +11 -9
- data/assets/javascripts/bootstrap/alert.js +6 -5
- data/assets/javascripts/bootstrap/button.js +24 -15
- data/assets/javascripts/bootstrap/carousel.js +24 -18
- data/assets/javascripts/bootstrap/collapse.js +13 -12
- data/assets/javascripts/bootstrap/dropdown.js +50 -46
- data/assets/javascripts/bootstrap/modal.js +77 -43
- data/assets/javascripts/bootstrap/popover.js +31 -27
- data/assets/javascripts/bootstrap/scrollspy.js +19 -22
- data/assets/javascripts/bootstrap/tab.js +14 -12
- data/assets/javascripts/bootstrap/tooltip.js +255 -56
- data/assets/javascripts/bootstrap/transition.js +5 -5
- data/assets/javascripts/bootstrap-sprockets.js +2 -2
- data/assets/javascripts/bootstrap.js +1280 -1004
- data/assets/javascripts/bootstrap.min.js +6 -0
- data/assets/stylesheets/_bootstrap-compass.scss +2 -0
- data/assets/stylesheets/_bootstrap-mincer.scss +4 -2
- data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
- data/assets/stylesheets/_bootstrap.scss +6 -0
- data/assets/stylesheets/bootstrap/_alerts.scss +8 -3
- data/assets/stylesheets/bootstrap/_badges.scss +9 -4
- data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
- data/assets/stylesheets/bootstrap/_button-groups.scss +11 -10
- data/assets/stylesheets/bootstrap/_buttons.scss +18 -10
- data/assets/stylesheets/bootstrap/_carousel.scss +40 -36
- data/assets/stylesheets/bootstrap/_close.scss +2 -0
- data/assets/stylesheets/bootstrap/_code.scss +3 -3
- data/assets/stylesheets/bootstrap/_component-animations.scss +2 -2
- data/assets/stylesheets/bootstrap/_dropdowns.scss +24 -24
- data/assets/stylesheets/bootstrap/_forms.scss +143 -84
- data/assets/stylesheets/bootstrap/_glyphicons.scss +85 -12
- data/assets/stylesheets/bootstrap/_grid.scss +10 -0
- data/assets/stylesheets/bootstrap/_input-groups.scss +10 -5
- data/assets/stylesheets/bootstrap/_jumbotron.scss +9 -4
- data/assets/stylesheets/bootstrap/_labels.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +30 -26
- data/assets/stylesheets/bootstrap/_media.scss +19 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
- data/assets/stylesheets/bootstrap/_modals.scss +11 -9
- data/assets/stylesheets/bootstrap/_navbar.scss +76 -82
- data/assets/stylesheets/bootstrap/_navs.scss +4 -6
- data/assets/stylesheets/bootstrap/_normalize.scss +13 -13
- data/assets/stylesheets/bootstrap/_pager.scss +2 -2
- data/assets/stylesheets/bootstrap/_pagination.scss +15 -17
- data/assets/stylesheets/bootstrap/_panels.scss +16 -6
- data/assets/stylesheets/bootstrap/_popovers.scss +50 -59
- data/assets/stylesheets/bootstrap/_print.scss +90 -98
- data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +10 -10
- data/assets/stylesheets/bootstrap/_responsive-utilities.scss +11 -6
- data/assets/stylesheets/bootstrap/_scaffolding.scss +18 -7
- data/assets/stylesheets/bootstrap/_tables.scss +24 -24
- data/assets/stylesheets/bootstrap/_theme.scss +45 -22
- data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
- data/assets/stylesheets/bootstrap/_tooltip.scss +42 -33
- data/assets/stylesheets/bootstrap/_type.scss +12 -12
- data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
- data/assets/stylesheets/bootstrap/_variables.scss +27 -17
- data/assets/stylesheets/bootstrap/_wells.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +20 -11
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -8
- data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
- data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -5
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +4 -4
- data/bootstrap-sass.gemspec +10 -9
- data/bower.json +6 -20
- data/composer.json +2 -2
- data/eyeglass-exports.js +7 -0
- data/lib/bootstrap-sass/engine.rb +6 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/lib/bootstrap-sass.rb +32 -13
- data/package-lock.json +1611 -0
- data/package.json +21 -7
- data/sache.json +1 -1
- data/tasks/bower.rake +2 -5
- data/tasks/converter/fonts_conversion.rb +1 -1
- data/tasks/converter/js_conversion.rb +7 -5
- data/tasks/converter/less_conversion.rb +47 -36
- data/tasks/converter/network.rb +12 -7
- data/tasks/converter.rb +1 -1
- data/templates/project/_bootstrap-variables.sass +27 -18
- data/templates/project/styles.sass +3 -0
- data/test/compilation_test.rb +24 -12
- data/test/dummy_rails/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
- data/test/dummy_rails/app/views/pages/root.html.slim +43 -0
- data/test/dummy_rails/config/application.rb +2 -1
- data/test/dummy_rails/config/boot.rb +1 -1
- data/test/dummy_rails/config/environments/development.rb +0 -3
- data/test/dummy_rails/config/environments/production.rb +7 -1
- data/test/dummy_rails/config/environments/test.rb +9 -1
- data/test/dummy_sass_only/Gemfile +1 -1
- data/test/dummy_sass_only/compile.rb +14 -7
- data/test/dummy_sass_only/import_all.scss +2 -0
- data/test/gemfiles/default.gemfile +3 -0
- data/test/node_mincer_test.rb +2 -3
- data/test/node_sass_compile_test.sh +4 -3
- data/test/sass_test.rb +10 -7
- data/test/sprockets_rails_test.rb +12 -8
- data/test/support/dummy_rails_integration.rb +1 -1
- data/test/support/reporting.rb +10 -0
- data/test/test_helper.rb +3 -2
- metadata +56 -46
- data/test/compass_test.rb +0 -9
- data/test/dummy_rails/log/development.log +0 -0
- data/test/dummy_sass_only/import_all.sass +0 -2
- data/test/gemfiles/sass_3_2.gemfile +0 -6
- data/test/gemfiles/sass_3_3.gemfile +0 -6
- data/test/gemfiles/sass_3_4.gemfile +0 -7
- data/test/gemfiles/sass_head.gemfile +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 58feea8410ac26aa16a8887d49c39915f01053fac4d547549f22ad09cca903a2
|
|
4
|
+
data.tar.gz: ab2888314daa99c23c67034bb52e89cab7ad5c80fc94cafa2aa000964e6ac4a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 524b345c929bbd2013145b9d0efff1e9a9ae40dd92bf10084bbed4d00f1cd4a629258d337d497131be7d386badf3a512951a82670a6e6e1fc82ff34a1d6002ca
|
|
7
|
+
data.tar.gz: cf05215a71378dcd0f25293cd32095d947b7b748113c3e89c1d65c6f5030dc50ad6b5ecc2817695f8d530ba0ec7ef388e819c4b232c68ad2d03a564718896051
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
+
dist: xenial
|
|
1
2
|
language: ruby
|
|
3
|
+
cache: bundler
|
|
4
|
+
bundler_args: --path ../../vendor/bundle --without debug
|
|
2
5
|
rvm:
|
|
3
|
-
- 2.1
|
|
4
|
-
- jruby
|
|
5
|
-
- rbx-2
|
|
6
|
+
- 2.5.1
|
|
6
7
|
gemfile:
|
|
7
|
-
- test/gemfiles/
|
|
8
|
-
- test/gemfiles/sass_3_3.gemfile
|
|
9
|
-
- test/gemfiles/sass_3_4.gemfile
|
|
10
|
-
- test/gemfiles/sass_head.gemfile
|
|
8
|
+
- test/gemfiles/default.gemfile
|
|
11
9
|
before_install:
|
|
10
|
+
- "nvm install stable"
|
|
12
11
|
- "npm install"
|
|
13
|
-
matrix:
|
|
14
|
-
allow_failures:
|
|
15
|
-
# rbx has issues https://github.com/rubinius/rubinius/issues/3060
|
|
16
|
-
- rvm: rbx-2
|
|
17
|
-
- gemfile: test/gemfiles/sass_head.gemfile
|
|
18
12
|
notifications:
|
|
19
13
|
slack: heybb:3n88HHilXn76ji9vV4gL819Y
|
|
20
14
|
env:
|
|
21
15
|
global:
|
|
22
16
|
- VERBOSE=1
|
|
23
17
|
script:
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
bundle exec rake && bash test/*.sh
|
|
19
|
+
sudo: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
* Bootstrap rubygem now depends on SassC instead of Sass.
|
|
6
|
+
* Compass no longer supported.
|
|
7
|
+
|
|
8
|
+
## 3.3.7
|
|
9
|
+
|
|
10
|
+
* Allows jQuery 3.x in bower.json. [#1048](https://github.com/twbs/bootstrap-sass/issues/1048)
|
|
11
|
+
* Adds the `style` and `sass` fields to package.json. [#1045](https://github.com/twbs/bootstrap-sass/issues/1045)
|
|
12
|
+
* Adds Eyeglass support. [#1007](https://github.com/twbs/bootstrap-sass/pull/1007)
|
|
13
|
+
|
|
14
|
+
## 3.3.6
|
|
15
|
+
|
|
16
|
+
* Bumps Sass dependency to 3.3.4+ to avoid compatibility issues with @at-root.
|
|
17
|
+
* Bumps node-sass dependency to ~3.4.2 for Node.js v5 compatibility. [#986](https://github.com/twbs/bootstrap-sass/issues/986)
|
|
18
|
+
* Fixes breadcrumb content issues on libsass. [#919](https://github.com/twbs/bootstrap-sass/issues/919)
|
|
19
|
+
* Fixes a Rails 5 compatibility issue. [#965](https://github.com/twbs/bootstrap-sass/pull/965)
|
|
20
|
+
|
|
21
|
+
Framework version: Bootstrap **v3.3.6**
|
|
22
|
+
|
|
23
|
+
## 3.3.5
|
|
24
|
+
|
|
25
|
+
Fix for standalone Compass extension compatibility. [#914](https://github.com/twbs/bootstrap-sass/issues/914)
|
|
26
|
+
|
|
27
|
+
Framework version: Bootstrap **v3.3.5**
|
|
28
|
+
|
|
29
|
+
## 3.3.4
|
|
30
|
+
|
|
31
|
+
No Sass-specific changes.
|
|
32
|
+
|
|
33
|
+
Framework version: Bootstrap **v3.3.4**
|
|
34
|
+
|
|
35
|
+
## 3.3.3
|
|
36
|
+
|
|
37
|
+
This is a re-packaged release of 3.3.2.1 (v3.3.2+1).
|
|
38
|
+
|
|
39
|
+
Versions are now strictly semver.
|
|
40
|
+
The PATCH version may be ahead of the upstream.
|
|
41
|
+
|
|
42
|
+
Framework version: Bootstrap **v3.3.2**.
|
|
43
|
+
|
|
44
|
+
## 3.3.2.1
|
|
45
|
+
|
|
46
|
+
* Fix glyphicons regression (revert 443d5b49eac84aec1cb2f8ea173554327bfc8c14)
|
|
47
|
+
|
|
48
|
+
## 3.3.2.0
|
|
49
|
+
|
|
50
|
+
* Autoprefixer is now required, and `autoprefixer-rails` is now a dependency for the ruby gem. [#824](https://github.com/twbs/bootstrap-sass/issues/824)
|
|
51
|
+
* Minimum precision reduced from 10 to 8 [#821](https://github.com/twbs/bootstrap-sass/issues/821)
|
|
52
|
+
* Requiring bootstrap JS from npm now works [#812](https://github.com/twbs/bootstrap-sass/issues/812)
|
|
53
|
+
* Fix Sass 3.4.x + IE10 compatibility issue [#803](https://github.com/twbs/bootstrap-sass/issues/803)
|
|
54
|
+
* Provide minified JS bundle [#777](https://github.com/twbs/bootstrap-sass/issues/777)
|
|
55
|
+
* Bower package is now at bootstrap-sass [#813](https://github.com/twbs/bootstrap-sass/issues/813)
|
|
56
|
+
|
|
57
|
+
|
|
3
58
|
## 3.3.1.0
|
|
4
59
|
|
|
5
60
|
* Variables override template at templates/project/_bootstrap-variables.sass
|
data/CONTRIBUTING.md
CHANGED
|
@@ -57,7 +57,11 @@ Example:
|
|
|
57
57
|
|
|
58
58
|
**We will not accept pull requests that modify the SCSS beyond fixing bugs caused by *our* code!**
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
We use a [converter script][converter-readme] to automatically convert upstream bootstrap, written in LESS, to Sass.
|
|
61
|
+
|
|
62
|
+
Issues related to styles or javascript but unrelated to the conversion process should go to [twbs/bootstrap][upstream].
|
|
63
|
+
|
|
64
|
+
Pull requests that fix bugs caused by our code should not modify the SCSS directly, but should patch the converter instead.
|
|
61
65
|
|
|
62
66
|
Good pull requests - patches, improvements, new features - are a fantastic
|
|
63
67
|
help. They should remain focused in scope and avoid containing unrelated
|
|
@@ -77,3 +81,6 @@ Please **do not** derail or troll issues. Keep the
|
|
|
77
81
|
discussion on topic and respect the opinions of others.
|
|
78
82
|
|
|
79
83
|
*props [html5-boilerplate](https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md)*
|
|
84
|
+
|
|
85
|
+
[upstream]: https://github.com/twbs/bootstrap
|
|
86
|
+
[converter-readme]: https://github.com/twbs/bootstrap-sass/blob/master/README.md#upstream-converter
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2011-2016 Twitter, Inc
|
|
4
|
+
Copyright (c) 2011-2016 The Bootstrap Authors
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
# Bootstrap for Sass
|
|
1
|
+
# Bootstrap 3 for Sass
|
|
2
|
+
[](http://badge.fury.io/rb/bootstrap-sass)
|
|
3
|
+
[](https://www.npmjs.com/package/bootstrap-sass)
|
|
4
|
+
[](http://badge.fury.io/bo/bootstrap-sass)
|
|
5
|
+
[](https://travis-ci.org/twbs/bootstrap-sass)
|
|
2
6
|
|
|
3
|
-
`bootstrap-sass` is a Sass-powered version of [Bootstrap](
|
|
7
|
+
`bootstrap-sass` is a Sass-powered version of [Bootstrap](https://github.com/twbs/bootstrap) 3, ready to drop right into your Sass powered applications.
|
|
8
|
+
|
|
9
|
+
This is Bootstrap **3**. For Bootstrap **4** use the [Bootstrap rubygem](https://github.com/twbs/bootstrap-rubygem) if you use Ruby, and the [main repo](https://github.com/twbs/bootstrap) otherwise.
|
|
4
10
|
|
|
5
11
|
## Installation
|
|
6
12
|
|
|
7
13
|
Please see the appropriate guide for your environment of choice:
|
|
8
14
|
|
|
9
15
|
* [Ruby on Rails](#a-ruby-on-rails).
|
|
10
|
-
* [
|
|
11
|
-
* [
|
|
16
|
+
* [Bower](#b-bower).
|
|
17
|
+
* [npm / Node.js](#c-npm--nodejs).
|
|
12
18
|
|
|
13
19
|
### a. Ruby on Rails
|
|
14
20
|
|
|
@@ -17,20 +23,13 @@ Please see the appropriate guide for your environment of choice:
|
|
|
17
23
|
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.
|
|
18
24
|
|
|
19
25
|
```ruby
|
|
20
|
-
gem 'bootstrap-sass', '~> 3.
|
|
21
|
-
gem '
|
|
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'
|
|
26
|
+
gem 'bootstrap-sass', '~> 3.4.1'
|
|
27
|
+
gem 'sassc-rails', '>= 2.1.0'
|
|
29
28
|
```
|
|
30
29
|
|
|
31
30
|
`bundle install` and restart your server to make the files available through the pipeline.
|
|
32
31
|
|
|
33
|
-
Import Bootstrap styles in `app/assets/stylesheets/application.
|
|
32
|
+
Import Bootstrap styles in `app/assets/stylesheets/application.scss`:
|
|
34
33
|
|
|
35
34
|
```scss
|
|
36
35
|
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
|
|
@@ -40,14 +39,27 @@ Import Bootstrap styles in `app/assets/stylesheets/application.css.scss`:
|
|
|
40
39
|
|
|
41
40
|
`bootstrap-sprockets` must be imported before `bootstrap` for the icon fonts to work.
|
|
42
41
|
|
|
43
|
-
Make sure the file has `.
|
|
44
|
-
it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so
|
|
42
|
+
Make sure the file has `.scss` extension (or `.sass` for Sass syntax). If you have just generated a new Rails app,
|
|
43
|
+
it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so rename it:
|
|
45
44
|
|
|
46
45
|
```console
|
|
47
|
-
$
|
|
46
|
+
$ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
|
|
48
47
|
```
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
Then, remove all the `*= require_self` and `*= require_tree .` statements from the sass file. Instead, use `@import` to import Sass files.
|
|
50
|
+
|
|
51
|
+
Do not use `*= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.
|
|
52
|
+
|
|
53
|
+
Bootstrap JavaScript depends on jQuery.
|
|
54
|
+
If you're using Rails 5.1+, add the `jquery-rails` gem to your Gemfile:
|
|
55
|
+
|
|
56
|
+
```ruby
|
|
57
|
+
gem 'jquery-rails'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```console
|
|
61
|
+
$ bundle install
|
|
62
|
+
```
|
|
51
63
|
|
|
52
64
|
Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
|
|
53
65
|
|
|
@@ -56,6 +68,11 @@ Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
|
|
|
56
68
|
//= require bootstrap-sprockets
|
|
57
69
|
```
|
|
58
70
|
|
|
71
|
+
`bootstrap-sprockets` and `bootstrap` [should not both be included](https://github.com/twbs/bootstrap-sass/issues/829#issuecomment-75153827) in `application.js`.
|
|
72
|
+
|
|
73
|
+
`bootstrap-sprockets` provides individual Bootstrap Javascript files (`alert.js` or `dropdown.js`, for example), while
|
|
74
|
+
`bootstrap` provides a concatenated file containing all Bootstrap Javascripts.
|
|
75
|
+
|
|
59
76
|
#### Bower with Rails
|
|
60
77
|
|
|
61
78
|
When using [bootstrap-sass Bower package](#c-bower) instead of the gem in Rails, configure assets in `config/application.rb`:
|
|
@@ -67,12 +84,12 @@ root.join('vendor', 'assets', 'bower_components').to_s.tap do |bower_path|
|
|
|
67
84
|
config.assets.paths << bower_path
|
|
68
85
|
end
|
|
69
86
|
# Precompile Bootstrap fonts
|
|
70
|
-
config.assets.precompile << %r(bootstrap-sass/assets/fonts/bootstrap/[\w-]+\.(?:eot|svg|ttf|
|
|
87
|
+
config.assets.precompile << %r(bootstrap-sass/assets/fonts/bootstrap/[\w-]+\.(?:eot|svg|ttf|woff2?)$)
|
|
71
88
|
# Minimum Sass number precision required by bootstrap-sass
|
|
72
|
-
::Sass::Script::Number.precision = [
|
|
89
|
+
::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
|
|
73
90
|
```
|
|
74
91
|
|
|
75
|
-
Replace Bootstrap `@import` statements in `application.
|
|
92
|
+
Replace Bootstrap `@import` statements in `application.scss` with:
|
|
76
93
|
|
|
77
94
|
```scss
|
|
78
95
|
$icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/";
|
|
@@ -94,64 +111,24 @@ Please make sure `sprockets-rails` is at least v2.1.4.
|
|
|
94
111
|
|
|
95
112
|
bootstrap-sass is no longer compatible with Rails 3. The latest version of bootstrap-sass compatible with Rails 3.2 is v3.1.1.0.
|
|
96
113
|
|
|
97
|
-
### b.
|
|
114
|
+
### b. Bower
|
|
98
115
|
|
|
99
|
-
|
|
100
|
-
```sh
|
|
101
|
-
gem install bootstrap-sass
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
If you have an existing Compass project:
|
|
105
|
-
|
|
106
|
-
```ruby
|
|
107
|
-
# config.rb:
|
|
108
|
-
require 'bootstrap-sass'
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
```console
|
|
112
|
-
$ bundle exec compass install bootstrap
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
If you are creating a new Compass project, you can generate it with bootstrap-sass support:
|
|
116
|
+
bootstrap-sass Bower package is compatible with node-sass 3.2.0+. You can install it with:
|
|
116
117
|
|
|
117
118
|
```console
|
|
118
|
-
$
|
|
119
|
+
$ bower install bootstrap-sass
|
|
119
120
|
```
|
|
120
121
|
|
|
121
|
-
or, alternatively, if you're not using a Gemfile for your dependencies:
|
|
122
|
-
|
|
123
|
-
```console
|
|
124
|
-
$ compass create my-new-project -r bootstrap-sass --using bootstrap
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
This will create a new Compass project with the following files in it:
|
|
128
|
-
|
|
129
|
-
* [styles.sass](/templates/project/styles.sass) - main project Sass file, imports Bootstrap and variables.
|
|
130
|
-
* [_bootstrap-variables.sass](/templates/project/_bootstrap-variables.sass) - all of Bootstrap variables, override them here.
|
|
131
|
-
|
|
132
|
-
Some bootstrap-sass mixins may conflict with the Compass ones.
|
|
133
|
-
If this happens, change the import order so that Compass mixins are loaded later.
|
|
134
|
-
|
|
135
|
-
### c. Bower
|
|
136
|
-
|
|
137
|
-
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:
|
|
138
|
-
|
|
139
|
-
```console
|
|
140
|
-
$ bower install bootstrap-sass-official
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
`bootstrap-sass` is taken so make sure you use the command above.
|
|
144
|
-
|
|
145
122
|
Sass, JS, and all other assets are located at [assets](/assets).
|
|
146
123
|
|
|
147
|
-
By default, `bower.json` main field list only the main `
|
|
124
|
+
By default, `bower.json` main field list only the main `_bootstrap.scss` and all the static assets (fonts and JS).
|
|
148
125
|
This is compatible by default with asset managers such as [wiredep](https://github.com/taptapship/wiredep).
|
|
149
126
|
|
|
150
127
|
#### Node.js Mincer
|
|
151
128
|
|
|
152
|
-
If you use [mincer][mincer] with node-sass, import
|
|
129
|
+
If you use [mincer][mincer] with node-sass, import Bootstrap like so:
|
|
153
130
|
|
|
154
|
-
In `application.css.ejs.scss` (NB **.css.ejs.
|
|
131
|
+
In `application.css.ejs.scss` (NB **.css.ejs.scss**):
|
|
155
132
|
|
|
156
133
|
```scss
|
|
157
134
|
// Import mincer asset paths helper integration
|
|
@@ -167,10 +144,15 @@ In `application.js`:
|
|
|
167
144
|
|
|
168
145
|
See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for mincer.
|
|
169
146
|
|
|
147
|
+
### c. npm / Node.js
|
|
148
|
+
```console
|
|
149
|
+
$ npm install bootstrap-sass
|
|
150
|
+
```
|
|
170
151
|
|
|
171
|
-
### Configuration
|
|
172
152
|
|
|
173
|
-
|
|
153
|
+
## Configuration
|
|
154
|
+
|
|
155
|
+
### Sass
|
|
174
156
|
|
|
175
157
|
By default all of Bootstrap is imported.
|
|
176
158
|
|
|
@@ -183,28 +165,39 @@ In the application Sass file, replace `@import 'bootstrap'` with:
|
|
|
183
165
|
@import 'bootstrap-custom';
|
|
184
166
|
```
|
|
185
167
|
|
|
186
|
-
|
|
168
|
+
### Sass: Number Precision
|
|
187
169
|
|
|
188
|
-
bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of
|
|
170
|
+
bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 8 (default is 5).
|
|
189
171
|
|
|
190
|
-
Precision is set for
|
|
191
|
-
When using
|
|
172
|
+
Precision is set for Ruby automatically when using the `sassc-rails` gem.
|
|
173
|
+
When using the npm or Bower version with Ruby, you can set it with:
|
|
192
174
|
|
|
193
175
|
```ruby
|
|
194
|
-
::Sass::Script::Number.precision = [
|
|
176
|
+
::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
|
|
195
177
|
```
|
|
196
178
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
179
|
+
### Sass: Autoprefixer
|
|
180
|
+
|
|
181
|
+
Bootstrap requires the use of [Autoprefixer][autoprefixer].
|
|
182
|
+
[Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from [Can I Use](https://caniuse.com/).
|
|
183
|
+
|
|
184
|
+
To match [upstream Bootstrap's level of browser compatibility](https://getbootstrap.com/getting-started/#support), set Autoprefixer's `browsers` option to:
|
|
185
|
+
```json
|
|
186
|
+
[
|
|
187
|
+
"Android 2.3",
|
|
188
|
+
"Android >= 4",
|
|
189
|
+
"Chrome >= 20",
|
|
190
|
+
"Firefox >= 24",
|
|
191
|
+
"Explorer >= 8",
|
|
192
|
+
"iOS >= 6",
|
|
193
|
+
"Opera >= 12",
|
|
194
|
+
"Safari >= 6"
|
|
195
|
+
]
|
|
196
|
+
```
|
|
204
197
|
|
|
205
|
-
|
|
198
|
+
### JavaScript
|
|
206
199
|
|
|
207
|
-
[`assets/javascripts/bootstrap.js`](/assets/javascripts/bootstrap.js) contains all of Bootstrap JavaScript,
|
|
200
|
+
[`assets/javascripts/bootstrap.js`](/assets/javascripts/bootstrap.js) contains all of Bootstrap's JavaScript,
|
|
208
201
|
concatenated in the [correct order](/assets/javascripts/bootstrap-sprockets.js).
|
|
209
202
|
|
|
210
203
|
|
|
@@ -226,7 +219,7 @@ You can check dependencies in the [Bootstrap JS documentation][jsdocs].
|
|
|
226
219
|
//= require bootstrap/dropdown
|
|
227
220
|
```
|
|
228
221
|
|
|
229
|
-
|
|
222
|
+
### Fonts
|
|
230
223
|
|
|
231
224
|
The fonts are referenced as:
|
|
232
225
|
|
|
@@ -247,19 +240,19 @@ When using bootstrap-sass with Compass, Sprockets, or Mincer, you **must** impor
|
|
|
247
240
|
|
|
248
241
|
### Sass
|
|
249
242
|
|
|
250
|
-
Import Bootstrap into a Sass file (for example, application.
|
|
243
|
+
Import Bootstrap into a Sass file (for example, `application.scss`) to get all of Bootstrap's styles, mixins and variables!
|
|
251
244
|
|
|
252
245
|
```scss
|
|
253
246
|
@import "bootstrap";
|
|
254
247
|
```
|
|
255
248
|
|
|
256
|
-
You can also include optional
|
|
249
|
+
You can also include optional Bootstrap theme:
|
|
257
250
|
|
|
258
251
|
```scss
|
|
259
252
|
@import "bootstrap/theme";
|
|
260
253
|
```
|
|
261
254
|
|
|
262
|
-
The full list of
|
|
255
|
+
The full list of Bootstrap variables can be found [here](https://getbootstrap.com/customize/#less-variables). You can override these by simply redefining the variable before the `@import` directive, e.g.:
|
|
263
256
|
|
|
264
257
|
```scss
|
|
265
258
|
$navbar-default-bg: #312312;
|
|
@@ -269,9 +262,38 @@ $navbar-default-color: $light-orange;
|
|
|
269
262
|
@import "bootstrap";
|
|
270
263
|
```
|
|
271
264
|
|
|
265
|
+
### Eyeglass
|
|
266
|
+
|
|
267
|
+
Bootstrap is available as an [Eyeglass](https://github.com/sass-eyeglass/eyeglass) module. After installing Bootstrap via NPM you can import the Bootstrap library via:
|
|
268
|
+
|
|
269
|
+
```scss
|
|
270
|
+
@import "bootstrap-sass/bootstrap"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
or import only the parts of Bootstrap you need:
|
|
274
|
+
|
|
275
|
+
```scss
|
|
276
|
+
@import "bootstrap-sass/bootstrap/variables";
|
|
277
|
+
@import "bootstrap-sass/bootstrap/mixins";
|
|
278
|
+
@import "bootstrap-sass/bootstrap/carousel";
|
|
279
|
+
```
|
|
280
|
+
|
|
272
281
|
## Version
|
|
273
282
|
|
|
274
|
-
|
|
283
|
+
Bootstrap for Sass version may differ from the upstream version in the last number, known as
|
|
284
|
+
[PATCH](https://semver.org/spec/v2.0.0.html). The patch version may be ahead of the corresponding upstream minor.
|
|
285
|
+
This happens when we need to release Sass-specific changes.
|
|
286
|
+
|
|
287
|
+
Before v3.3.2, Bootstrap for Sass version used to reflect the upstream version, with an additional number for
|
|
288
|
+
Sass-specific changes. This was changed due to Bower and npm compatibility issues.
|
|
289
|
+
|
|
290
|
+
The upstream versions vs the Bootstrap for Sass versions are:
|
|
291
|
+
|
|
292
|
+
| Upstream | Sass |
|
|
293
|
+
|---------:|--------:|
|
|
294
|
+
| 3.3.4+ | same |
|
|
295
|
+
| 3.3.2 | 3.3.3 |
|
|
296
|
+
| <= 3.3.1 | 3.3.1.x |
|
|
275
297
|
|
|
276
298
|
Always refer to [CHANGELOG.md](/CHANGELOG.md) when upgrading.
|
|
277
299
|
|
|
@@ -300,8 +322,8 @@ To convert a specific branch or version, pass the branch name or the commit hash
|
|
|
300
322
|
|
|
301
323
|
The latest converter script is located [here][converter] and does the following:
|
|
302
324
|
|
|
303
|
-
* Converts upstream
|
|
304
|
-
* Copies all upstream JavaScript into `assets/javascripts/bootstrap`,
|
|
325
|
+
* Converts upstream Bootstrap LESS files to its matching SCSS file.
|
|
326
|
+
* 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`.
|
|
305
327
|
* Copies all upstream font files into `assets/fonts/bootstrap`.
|
|
306
328
|
* Sets `Bootstrap::BOOTSTRAP_SHA` in [version.rb][version] to the branch sha.
|
|
307
329
|
|
|
@@ -322,15 +344,15 @@ and a [significant number of other contributors][contrib].
|
|
|
322
344
|
|
|
323
345
|
## You're in good company
|
|
324
346
|
bootstrap-sass is used to build some awesome projects all over the web, including
|
|
325
|
-
[Diaspora](
|
|
326
|
-
Michael Hartl's [Rails Tutorial](
|
|
327
|
-
[kandan](http://
|
|
347
|
+
[Diaspora](https://diasporafoundation.org/), [rails_admin](https://github.com/sferik/rails_admin),
|
|
348
|
+
Michael Hartl's [Rails Tutorial](https://www.railstutorial.org/), [gitlabhq](http://gitlabhq.com/) and
|
|
349
|
+
[kandan](http://getkandan.com/).
|
|
328
350
|
|
|
329
351
|
[converter]: https://github.com/twbs/bootstrap-sass/blob/master/tasks/converter/less_conversion.rb
|
|
330
352
|
[version]: https://github.com/twbs/bootstrap-sass/blob/master/lib/bootstrap-sass/version.rb
|
|
331
353
|
[contrib]: https://github.com/twbs/bootstrap-sass/graphs/contributors
|
|
332
354
|
[antirequire]: https://github.com/twbs/bootstrap-sass/issues/79#issuecomment-4428595
|
|
333
|
-
[jsdocs]:
|
|
334
|
-
[sass-precision]: http://sass-lang.com/documentation/Sass/Script/Number.html#precision-class_method
|
|
355
|
+
[jsdocs]: https://getbootstrap.com/javascript/#transitions
|
|
356
|
+
[sass-precision]: http://sass-lang.com/documentation/Sass/Script/Value/Number.html#precision%3D-class_method
|
|
335
357
|
[mincer]: https://github.com/nodeca/mincer
|
|
336
|
-
[autoprefixer]: https://github.com/
|
|
358
|
+
[autoprefixer]: https://github.com/postcss/autoprefixer
|
data/Rakefile
CHANGED
|
@@ -1,21 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
|
|
3
|
+
lib_path = File.join(__dir__, 'lib')
|
|
2
4
|
$:.unshift(lib_path) unless $:.include?(lib_path)
|
|
3
5
|
|
|
4
6
|
load './tasks/bower.rake'
|
|
5
7
|
|
|
6
8
|
require 'rake/testtask'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
Rake::TestTask.new do |t|
|
|
10
|
+
t.libs << 'test'
|
|
11
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
12
|
+
t.verbose = true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc 'Test all Gemfiles from test/*.gemfile'
|
|
16
|
+
task :test_all_gemfiles do
|
|
17
|
+
require 'term/ansicolor'
|
|
18
|
+
require 'pty'
|
|
19
|
+
require 'shellwords'
|
|
20
|
+
cmd = 'bundle install --quiet && bundle exec rake --trace'
|
|
21
|
+
statuses = Dir.glob('./test/gemfiles/*{[!.lock]}').map do |gemfile|
|
|
22
|
+
env = {'BUNDLE_GEMFILE' => gemfile}
|
|
23
|
+
cmd_with_env = " (#{env.map { |k, v| "export #{k}=#{Shellwords.escape v}" } * ' '}; #{cmd})"
|
|
24
|
+
$stderr.puts Term::ANSIColor.cyan("Testing\n#{cmd_with_env}")
|
|
25
|
+
PTY.spawn(env, cmd) do |r, _w, pid|
|
|
26
|
+
begin
|
|
27
|
+
r.each_line { |l| puts l }
|
|
28
|
+
rescue Errno::EIO
|
|
29
|
+
# Errno:EIO error means that the process has finished giving output.
|
|
30
|
+
ensure
|
|
31
|
+
::Process.wait pid
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
[$? && $?.exitstatus == 0, cmd_with_env]
|
|
35
|
+
end
|
|
36
|
+
failed_cmds = statuses.reject(&:first).map { |(_status, cmd_with_env)| cmd_with_env }
|
|
37
|
+
if failed_cmds.empty?
|
|
38
|
+
$stderr.puts Term::ANSIColor.green('Tests pass with all gemfiles')
|
|
39
|
+
else
|
|
40
|
+
$stderr.puts Term::ANSIColor.red("Failing (#{failed_cmds.size} / #{statuses.size})\n#{failed_cmds * "\n"}")
|
|
41
|
+
exit 1
|
|
42
|
+
end
|
|
10
43
|
end
|
|
11
44
|
|
|
12
45
|
desc 'Dumps output to a CSS file for testing'
|
|
13
46
|
task :debug do
|
|
14
|
-
require '
|
|
47
|
+
require 'sassc'
|
|
48
|
+
require 'bootstrap-sass'
|
|
15
49
|
path = Bootstrap.stylesheets_path
|
|
16
|
-
%w(
|
|
17
|
-
engine =
|
|
18
|
-
File.open("
|
|
50
|
+
%w(_bootstrap).each do |file|
|
|
51
|
+
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: ['.', path])
|
|
52
|
+
File.open("tmp/#{file}.css", 'w') { |f| f.write(engine.render) }
|
|
19
53
|
end
|
|
20
54
|
end
|
|
21
55
|
|
|
@@ -33,20 +67,32 @@ end
|
|
|
33
67
|
|
|
34
68
|
desc 'Compile bootstrap-sass to tmp/ (or first arg)'
|
|
35
69
|
task :compile, :css_path do |t, args|
|
|
36
|
-
require '
|
|
70
|
+
require 'sassc'
|
|
71
|
+
require 'bootstrap-sass'
|
|
37
72
|
require 'term/ansicolor'
|
|
38
73
|
|
|
39
74
|
path = 'assets/stylesheets'
|
|
40
75
|
css_path = args.with_defaults(css_path: 'tmp')[:css_path]
|
|
41
76
|
puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
|
|
42
77
|
Dir.mkdir(css_path) unless File.directory?(css_path)
|
|
43
|
-
%w(
|
|
78
|
+
%w(_bootstrap bootstrap/_theme).each do |file|
|
|
44
79
|
save_path = "#{css_path}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
|
|
45
80
|
puts Term::ANSIColor.cyan(" #{save_path}") + '...'
|
|
46
|
-
engine
|
|
47
|
-
css
|
|
81
|
+
engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: ['.', path])
|
|
82
|
+
css = engine.render
|
|
48
83
|
File.open(save_path, 'w') { |f| f.write css }
|
|
49
84
|
end
|
|
50
85
|
end
|
|
51
86
|
|
|
87
|
+
desc 'Start a dummy (test) Rails app server'
|
|
88
|
+
task :dummy_rails do
|
|
89
|
+
require 'rack'
|
|
90
|
+
require 'term/ansicolor'
|
|
91
|
+
port = ENV['PORT'] || 9292
|
|
92
|
+
puts %Q(Starting on #{Term::ANSIColor.cyan "http://localhost:#{port}"})
|
|
93
|
+
Rack::Server.start(
|
|
94
|
+
config: 'test/dummy_rails/config.ru',
|
|
95
|
+
Port: port)
|
|
96
|
+
end
|
|
97
|
+
|
|
52
98
|
task default: :test
|
|
Binary file
|