bootstrap-sass 3.3.0.1 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +8 -14
  4. data/CHANGELOG.md +64 -0
  5. data/CONTRIBUTING.md +8 -1
  6. data/Gemfile +1 -4
  7. data/LICENSE +2 -1
  8. data/README.md +135 -114
  9. data/Rakefile +58 -12
  10. data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  11. data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
  12. data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  13. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  14. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  15. data/assets/javascripts/bootstrap/affix.js +11 -9
  16. data/assets/javascripts/bootstrap/alert.js +6 -5
  17. data/assets/javascripts/bootstrap/button.js +25 -16
  18. data/assets/javascripts/bootstrap/carousel.js +25 -18
  19. data/assets/javascripts/bootstrap/collapse.js +13 -12
  20. data/assets/javascripts/bootstrap/dropdown.js +51 -47
  21. data/assets/javascripts/bootstrap/modal.js +112 -35
  22. data/assets/javascripts/bootstrap/popover.js +31 -27
  23. data/assets/javascripts/bootstrap/scrollspy.js +19 -22
  24. data/assets/javascripts/bootstrap/tab.js +14 -12
  25. data/assets/javascripts/bootstrap/tooltip.js +255 -56
  26. data/assets/javascripts/bootstrap/transition.js +5 -5
  27. data/assets/javascripts/bootstrap-sprockets.js +2 -2
  28. data/assets/javascripts/bootstrap.js +1282 -962
  29. data/assets/javascripts/bootstrap.min.js +6 -0
  30. data/assets/stylesheets/_bootstrap-compass.scss +2 -0
  31. data/assets/stylesheets/_bootstrap-mincer.scss +4 -2
  32. data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
  33. data/assets/stylesheets/_bootstrap.scss +6 -0
  34. data/assets/stylesheets/bootstrap/_alerts.scss +8 -3
  35. data/assets/stylesheets/bootstrap/_badges.scss +16 -5
  36. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
  37. data/assets/stylesheets/bootstrap/_button-groups.scss +11 -14
  38. data/assets/stylesheets/bootstrap/_buttons.scss +18 -10
  39. data/assets/stylesheets/bootstrap/_carousel.scss +40 -36
  40. data/assets/stylesheets/bootstrap/_close.scss +2 -0
  41. data/assets/stylesheets/bootstrap/_code.scss +3 -3
  42. data/assets/stylesheets/bootstrap/_component-animations.scss +2 -2
  43. data/assets/stylesheets/bootstrap/_dropdowns.scss +24 -24
  44. data/assets/stylesheets/bootstrap/_forms.scss +149 -103
  45. data/assets/stylesheets/bootstrap/_glyphicons.scss +85 -12
  46. data/assets/stylesheets/bootstrap/_grid.scss +10 -0
  47. data/assets/stylesheets/bootstrap/_input-groups.scss +10 -5
  48. data/assets/stylesheets/bootstrap/_jumbotron.scss +11 -5
  49. data/assets/stylesheets/bootstrap/_labels.scss +1 -1
  50. data/assets/stylesheets/bootstrap/_list-group.scss +30 -34
  51. data/assets/stylesheets/bootstrap/_media.scss +19 -0
  52. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  53. data/assets/stylesheets/bootstrap/_modals.scss +9 -8
  54. data/assets/stylesheets/bootstrap/_navbar.scss +77 -82
  55. data/assets/stylesheets/bootstrap/_navs.scss +4 -6
  56. data/assets/stylesheets/bootstrap/_normalize.scss +13 -13
  57. data/assets/stylesheets/bootstrap/_pager.scss +2 -2
  58. data/assets/stylesheets/bootstrap/_pagination.scss +15 -17
  59. data/assets/stylesheets/bootstrap/_panels.scss +16 -6
  60. data/assets/stylesheets/bootstrap/_popovers.scss +50 -58
  61. data/assets/stylesheets/bootstrap/_print.scss +90 -98
  62. data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
  63. data/assets/stylesheets/bootstrap/_responsive-embed.scss +10 -10
  64. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +11 -6
  65. data/assets/stylesheets/bootstrap/_scaffolding.scss +18 -7
  66. data/assets/stylesheets/bootstrap/_tables.scss +24 -24
  67. data/assets/stylesheets/bootstrap/_theme.scss +57 -22
  68. data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
  69. data/assets/stylesheets/bootstrap/_tooltip.scss +49 -32
  70. data/assets/stylesheets/bootstrap/_type.scss +12 -12
  71. data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
  72. data/assets/stylesheets/bootstrap/_variables.scss +27 -17
  73. data/assets/stylesheets/bootstrap/_wells.scss +2 -2
  74. data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
  75. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
  77. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +20 -11
  78. data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
  79. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
  80. data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
  82. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
  83. data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -8
  84. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +3 -3
  85. data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
  86. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  87. data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
  88. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
  89. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
  90. data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  91. data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -5
  92. data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
  93. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
  94. data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +4 -4
  95. data/bootstrap-sass.gemspec +10 -9
  96. data/bower.json +6 -20
  97. data/composer.json +2 -2
  98. data/eyeglass-exports.js +7 -0
  99. data/lib/bootstrap-sass/engine.rb +6 -1
  100. data/lib/bootstrap-sass/version.rb +2 -2
  101. data/lib/bootstrap-sass.rb +32 -13
  102. data/package-lock.json +1611 -0
  103. data/package.json +21 -7
  104. data/sache.json +1 -1
  105. data/tasks/bower.rake +2 -5
  106. data/tasks/converter/fonts_conversion.rb +1 -1
  107. data/tasks/converter/js_conversion.rb +7 -5
  108. data/tasks/converter/less_conversion.rb +48 -37
  109. data/tasks/converter/network.rb +12 -7
  110. data/tasks/converter.rb +1 -1
  111. data/templates/project/_bootstrap-variables.sass +27 -18
  112. data/templates/project/styles.sass +3 -0
  113. data/test/compilation_test.rb +24 -12
  114. data/test/dummy_rails/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
  115. data/test/dummy_rails/app/views/pages/root.html.slim +43 -0
  116. data/test/dummy_rails/config/application.rb +2 -1
  117. data/test/dummy_rails/config/boot.rb +1 -1
  118. data/test/dummy_rails/config/environments/development.rb +0 -3
  119. data/test/dummy_rails/config/environments/production.rb +7 -1
  120. data/test/dummy_rails/config/environments/test.rb +9 -1
  121. data/test/dummy_sass_only/Gemfile +1 -1
  122. data/test/dummy_sass_only/compile.rb +14 -7
  123. data/test/dummy_sass_only/import_all.scss +2 -0
  124. data/test/gemfiles/default.gemfile +3 -0
  125. data/test/node_mincer_test.rb +2 -3
  126. data/test/node_sass_compile_test.sh +4 -3
  127. data/test/sass_test.rb +10 -7
  128. data/test/sprockets_rails_test.rb +12 -8
  129. data/test/support/dummy_rails_integration.rb +1 -1
  130. data/test/support/reporting.rb +10 -0
  131. data/test/test_helper.rb +3 -2
  132. metadata +56 -46
  133. data/test/compass_test.rb +0 -9
  134. data/test/dummy_rails/log/development.log +0 -0
  135. data/test/dummy_sass_only/import_all.sass +0 -2
  136. data/test/gemfiles/sass_3_2.gemfile +0 -6
  137. data/test/gemfiles/sass_3_3.gemfile +0 -6
  138. data/test/gemfiles/sass_3_4.gemfile +0 -7
  139. data/test/gemfiles/sass_head.gemfile +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 31033a372c2d4db203ed619a90f1c2e82581042e
4
- data.tar.gz: ddbeb169e705fed90b1a8a09d719f5f3454e2e25
2
+ SHA256:
3
+ metadata.gz: 58feea8410ac26aa16a8887d49c39915f01053fac4d547549f22ad09cca903a2
4
+ data.tar.gz: ab2888314daa99c23c67034bb52e89cab7ad5c80fc94cafa2aa000964e6ac4a6
5
5
  SHA512:
6
- metadata.gz: 377849974184f5bb57f9237856db197795b41458841254b273278d188aa52500ca324f3ce8a97f3e8debcf3a35c45874eda8136df57d131cbabab66e61e11b22
7
- data.tar.gz: 0d5734cc3e93595a6de71d7616a4502f91d69d108c0f3141f7b710612dcb3271e3484a0aa6716e1087c78a3623e6ceecd66d10496e4a580d716f1ae6daf83ae1
6
+ metadata.gz: 524b345c929bbd2013145b9d0efff1e9a9ae40dd92bf10084bbed4d00f1cd4a629258d337d497131be7d386badf3a512951a82670a6e6e1fc82ff34a1d6002ca
7
+ data.tar.gz: cf05215a71378dcd0f25293cd32095d947b7b748113c3e89c1d65c6f5030dc50ad6b5ecc2817695f8d530ba0ec7ef388e819c4b232c68ad2d03a564718896051
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/dummy_rails/log/*.log
17
17
  test/dummy_rails/public/assets/
18
18
  .DS_Store
19
19
  node_modules
20
+ /.idea
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.2
4
- - jruby
5
- - rbx-2
6
+ - 2.5.1
6
7
  gemfile:
7
- - test/gemfiles/sass_3_2.gemfile
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
- - bundle exec rake
25
- - sh test/*.sh
18
+ bundle exec rake && bash test/*.sh
19
+ sudo: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
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
+
58
+ ## 3.3.1.0
59
+
60
+ * Variables override template at templates/project/_bootstrap-variables.sass
61
+ * Readme: Bower + Rails configuration
62
+
63
+ ## 3.3.0.1
64
+
65
+ * Fix loading issue with the ruby gem version
66
+
3
67
  ## 3.3.0
4
68
 
5
69
  * Improve libsass compatibility
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
- Most pull requests should go to [twbs/bootstrap](https://github.com/twbs/bootstrap) or [jlong/sass-twitter-bootstrap](https://github.com/jlong/sass-twitter-bootstrap)
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
@@ -2,9 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- # Compass for the dummy app
6
- gem 'compass', require: false
7
-
8
5
  group :development do
9
- gem 'byebug', platform: :mri_21, require: false
6
+ gem 'byebug', platform: :mri, require: false
10
7
  end
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2013 Twitter, Inc
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 [![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)
1
+ # Bootstrap 3 for Sass
2
+ [![Gem Version](https://badge.fury.io/rb/bootstrap-sass.svg)](http://badge.fury.io/rb/bootstrap-sass)
3
+ [![npm version](https://img.shields.io/npm/v/bootstrap-sass.svg?style=flat)](https://www.npmjs.com/package/bootstrap-sass)
4
+ [![Bower Version](https://badge.fury.io/bo/bootstrap-sass.svg)](http://badge.fury.io/bo/bootstrap-sass)
5
+ [![Build Status](https://img.shields.io/travis/twbs/bootstrap-sass.svg)](https://travis-ci.org/twbs/bootstrap-sass)
2
6
 
3
- `bootstrap-sass` is a Sass-powered version of [Bootstrap](http://github.com/twbs/bootstrap), ready to drop right into your Sass powered applications.
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
- * [Compass](#b-compass-without-rails) not on Rails.
11
- * [Bower](#c-bower).
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.3.0'
21
- gem 'sass-rails', '>= 3.2'
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.css.scss`:
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,119 +39,96 @@ 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 `.css.scss` extension (or `.css.sass` for Sass syntax). If you have just generated a new Rails app,
44
- it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it:
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
- $ rm app/assets/stylesheets/application.css
46
+ $ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
48
47
  ```
49
48
 
50
- Do not use `//= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.
49
+ Then, remove all the `*= require_self` and `*= require_tree .` statements from the sass file. Instead, use `@import` to import Sass files.
51
50
 
52
- Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
51
+ Do not use `*= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.
53
52
 
54
- ```js
55
- //= require jquery
56
- //= require bootstrap-sprockets
57
- ```
58
-
59
- #### Bower with Rails
60
-
61
- When using [bootstrap-sass Bower package](#c-bower) instead of the gem in Rails, add Bootstrap asset paths:
53
+ Bootstrap JavaScript depends on jQuery.
54
+ If you're using Rails 5.1+, add the `jquery-rails` gem to your Gemfile:
62
55
 
63
56
  ```ruby
64
- # config/application.rb
65
- # bootstrap-sass asset paths
66
- root.join('vendor/assets/bower_components/bootstrap-sass/assets').tap do |path|
67
- config.sass.load_paths << path.join('stylesheets')
68
- config.assets.paths += %w(javascripts fonts images).map(&path.method(:join))
69
- end
57
+ gem 'jquery-rails'
70
58
  ```
71
59
 
72
- Then, ensure [minimum Sass number precision](#sass-number-precision):
73
-
74
- ```ruby
75
- # config/initializers/sass.rb
76
- # Minimum precision required by bootstrap-sass
77
- ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
60
+ ```console
61
+ $ bundle install
78
62
  ```
79
63
 
80
- #### Rails 4.x
81
-
82
- Please make sure `sprockets-rails` is at least v2.1.4.
83
-
84
- #### Rails 3.2.x
85
-
86
- Rails 3.2 is [no longer maintained for bugfixes](http://guides.rubyonrails.org/maintenance_policy.html), and you should upgrade as soon as possible.
87
-
88
- Starting with bootstrap-sass v3.1.1.1, due to the structural changes from upstream you will need these
89
- backported asset pipeline gems on Rails 3.2. There is more on why this is necessary in
90
- https://github.com/twbs/bootstrap-sass/issues/523 and https://github.com/twbs/bootstrap-sass/issues/578.
64
+ Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
91
65
 
92
- ```ruby
93
- gem 'sprockets-rails', '=2.0.0.backport1'
94
- gem 'sprockets', '=2.2.2.backport2'
95
- gem 'sass-rails', github: 'guilleiguaran/sass-rails', branch: 'backport'
66
+ ```js
67
+ //= require jquery
68
+ //= require bootstrap-sprockets
96
69
  ```
97
70
 
98
- ### b. Compass without Rails
71
+ `bootstrap-sprockets` and `bootstrap` [should not both be included](https://github.com/twbs/bootstrap-sass/issues/829#issuecomment-75153827) in `application.js`.
99
72
 
100
- Install the gem
101
- ```sh
102
- gem install bootstrap-sass
103
- ```
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.
104
75
 
105
- If you have an existing Compass project:
76
+ #### Bower with Rails
106
77
 
107
- ```ruby
108
- # config.rb:
109
- require 'bootstrap-sass'
110
- ```
78
+ When using [bootstrap-sass Bower package](#c-bower) instead of the gem in Rails, configure assets in `config/application.rb`:
111
79
 
112
- ```console
113
- $ bundle exec compass install bootstrap
80
+ ```ruby
81
+ # Bower asset paths
82
+ root.join('vendor', 'assets', 'bower_components').to_s.tap do |bower_path|
83
+ config.sass.load_paths << bower_path
84
+ config.assets.paths << bower_path
85
+ end
86
+ # Precompile Bootstrap fonts
87
+ config.assets.precompile << %r(bootstrap-sass/assets/fonts/bootstrap/[\w-]+\.(?:eot|svg|ttf|woff2?)$)
88
+ # Minimum Sass number precision required by bootstrap-sass
89
+ ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
114
90
  ```
115
91
 
116
- If you are creating a new Compass project, you can generate it with bootstrap-sass support:
92
+ Replace Bootstrap `@import` statements in `application.scss` with:
117
93
 
118
- ```console
119
- $ bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
94
+ ```scss
95
+ $icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/";
96
+ @import "bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
97
+ @import "bootstrap-sass/assets/stylesheets/bootstrap";
120
98
  ```
121
99
 
122
- or, alternatively, if you're not using a Gemfile for your dependencies:
100
+ Replace Bootstrap `require` directive in `application.js` with:
123
101
 
124
- ```console
125
- $ compass create my-new-project -r bootstrap-sass --using bootstrap
102
+ ```js
103
+ //= require bootstrap-sass/assets/javascripts/bootstrap-sprockets
126
104
  ```
127
105
 
128
- This will create a new Compass project with the following files in it:
106
+ #### Rails 4.x
107
+
108
+ Please make sure `sprockets-rails` is at least v2.1.4.
129
109
 
130
- * [styles.sass](/templates/project/styles.sass) - main project Sass file, imports Bootstrap and variables.
131
- * [_bootstrap-variables.sass](/templates/project/_bootstrap-variables.sass.erb) - all of Bootstrap variables, override them here.
110
+ #### Rails 3.2.x
132
111
 
133
- Some bootstrap-sass mixins may conflict with the Compass ones.
134
- If this happens, change the import order so that Compass mixins are loaded later.
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.
135
113
 
136
- ### c. Bower
114
+ ### b. Bower
137
115
 
138
- 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:
116
+ bootstrap-sass Bower package is compatible with node-sass 3.2.0+. You can install it with:
139
117
 
140
118
  ```console
141
- $ bower install bootstrap-sass-official
119
+ $ bower install bootstrap-sass
142
120
  ```
143
121
 
144
- `bootstrap-sass` is taken so make sure you use the command above.
145
-
146
122
  Sass, JS, and all other assets are located at [assets](/assets).
147
123
 
148
- By default, `bower.json` main field list only the main `bootstrap.scss` and all the static assets (fonts and JS).
124
+ By default, `bower.json` main field list only the main `_bootstrap.scss` and all the static assets (fonts and JS).
149
125
  This is compatible by default with asset managers such as [wiredep](https://github.com/taptapship/wiredep).
150
126
 
151
127
  #### Node.js Mincer
152
128
 
153
- If you use [mincer][mincer] with node-sass, import bootstrap into like so:
129
+ If you use [mincer][mincer] with node-sass, import Bootstrap like so:
154
130
 
155
- In `application.css.ejs.scss` (NB **.css.ejs.css**):
131
+ In `application.css.ejs.scss` (NB **.css.ejs.scss**):
156
132
 
157
133
  ```scss
158
134
  // Import mincer asset paths helper integration
@@ -168,10 +144,15 @@ In `application.js`:
168
144
 
169
145
  See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for mincer.
170
146
 
147
+ ### c. npm / Node.js
148
+ ```console
149
+ $ npm install bootstrap-sass
150
+ ```
171
151
 
172
- ### Configuration
173
152
 
174
- #### Sass
153
+ ## Configuration
154
+
155
+ ### Sass
175
156
 
176
157
  By default all of Bootstrap is imported.
177
158
 
@@ -184,28 +165,39 @@ In the application Sass file, replace `@import 'bootstrap'` with:
184
165
  @import 'bootstrap-custom';
185
166
  ```
186
167
 
187
- #### Sass: Number Precision
168
+ ### Sass: Number Precision
188
169
 
189
- bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 10 (default is 5).
170
+ bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 8 (default is 5).
190
171
 
191
- Precision is set for Rails and Compass automatically.
192
- When using ruby Sass compiler standalone or with the Bower version you can set it with:
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:
193
174
 
194
175
  ```ruby
195
- ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
176
+ ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
196
177
  ```
197
178
 
198
- 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.
199
-
200
-
201
- #### Sass: Autoprefixer
202
-
203
- Using [Autoprefixer][autoprefixer] with Bootstrap is recommended.
204
- [Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from [Can I Use](http://caniuse.com/).
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
+ ```
205
197
 
206
- #### JavaScript
198
+ ### JavaScript
207
199
 
208
- [`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,
209
201
  concatenated in the [correct order](/assets/javascripts/bootstrap-sprockets.js).
210
202
 
211
203
 
@@ -227,7 +219,7 @@ You can check dependencies in the [Bootstrap JS documentation][jsdocs].
227
219
  //= require bootstrap/dropdown
228
220
  ```
229
221
 
230
- #### Fonts
222
+ ### Fonts
231
223
 
232
224
  The fonts are referenced as:
233
225
 
@@ -248,19 +240,19 @@ When using bootstrap-sass with Compass, Sprockets, or Mincer, you **must** impor
248
240
 
249
241
  ### Sass
250
242
 
251
- Import Bootstrap into a Sass file (for example, application.css.scss) to get all of Bootstrap's styles, mixins and variables!
243
+ Import Bootstrap into a Sass file (for example, `application.scss`) to get all of Bootstrap's styles, mixins and variables!
252
244
 
253
245
  ```scss
254
246
  @import "bootstrap";
255
247
  ```
256
248
 
257
- You can also include optional bootstrap theme:
249
+ You can also include optional Bootstrap theme:
258
250
 
259
251
  ```scss
260
252
  @import "bootstrap/theme";
261
253
  ```
262
254
 
263
- The full list of bootstrap variables can be found [here](http://getbootstrap.com/customize/#less-variables). You can override these by simply redefining the variable before the `@import` directive, e.g.:
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.:
264
256
 
265
257
  ```scss
266
258
  $navbar-default-bg: #312312;
@@ -270,9 +262,38 @@ $navbar-default-color: $light-orange;
270
262
  @import "bootstrap";
271
263
  ```
272
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
+
273
281
  ## Version
274
282
 
275
- `bootstrap-sass` version reflects the upstream version, with an additional number for Sass-specific changes.
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 |
276
297
 
277
298
  Always refer to [CHANGELOG.md](/CHANGELOG.md) when upgrading.
278
299
 
@@ -301,8 +322,8 @@ To convert a specific branch or version, pass the branch name or the commit hash
301
322
 
302
323
  The latest converter script is located [here][converter] and does the following:
303
324
 
304
- * Converts upstream bootstrap LESS files to its matching SCSS file.
305
- * 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`.
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`.
306
327
  * Copies all upstream font files into `assets/fonts/bootstrap`.
307
328
  * Sets `Bootstrap::BOOTSTRAP_SHA` in [version.rb][version] to the branch sha.
308
329
 
@@ -323,15 +344,15 @@ and a [significant number of other contributors][contrib].
323
344
 
324
345
  ## You're in good company
325
346
  bootstrap-sass is used to build some awesome projects all over the web, including
326
- [Diaspora](http://diasporaproject.org/), [rails_admin](https://github.com/sferik/rails_admin),
327
- Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://gitlabhq.com/) and
328
- [kandan](http://kandanapp.com/).
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/).
329
350
 
330
351
  [converter]: https://github.com/twbs/bootstrap-sass/blob/master/tasks/converter/less_conversion.rb
331
352
  [version]: https://github.com/twbs/bootstrap-sass/blob/master/lib/bootstrap-sass/version.rb
332
353
  [contrib]: https://github.com/twbs/bootstrap-sass/graphs/contributors
333
354
  [antirequire]: https://github.com/twbs/bootstrap-sass/issues/79#issuecomment-4428595
334
- [jsdocs]: http://getbootstrap.com/javascript/#transitions
335
- [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
336
357
  [mincer]: https://github.com/nodeca/mincer
337
- [autoprefixer]: https://github.com/ai/autoprefixer
358
+ [autoprefixer]: https://github.com/postcss/autoprefixer
data/Rakefile CHANGED
@@ -1,21 +1,55 @@
1
- lib_path = File.join(File.dirname(__FILE__), 'lib')
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
- task :test do |t|
8
- $: << File.expand_path('test/')
9
- Dir.glob('./test/**/*_test.rb').each { |file| require file }
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 'sass'
47
+ require 'sassc'
48
+ require 'bootstrap-sass'
15
49
  path = Bootstrap.stylesheets_path
16
- %w(bootstrap).each do |file|
17
- engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
18
- File.open("./#{file}.css", 'w') { |f| f.write(engine.render) }
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 'sass'
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(bootstrap bootstrap/_theme).each do |file|
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 = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
47
- css = engine.render
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