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.
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 +55 -0
  5. data/CONTRIBUTING.md +8 -1
  6. data/Gemfile +1 -4
  7. data/LICENSE +2 -1
  8. data/README.md +118 -96
  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 +24 -15
  18. data/assets/javascripts/bootstrap/carousel.js +24 -18
  19. data/assets/javascripts/bootstrap/collapse.js +13 -12
  20. data/assets/javascripts/bootstrap/dropdown.js +50 -46
  21. data/assets/javascripts/bootstrap/modal.js +77 -43
  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 +1280 -1004
  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 +9 -4
  36. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
  37. data/assets/stylesheets/bootstrap/_button-groups.scss +11 -10
  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 +143 -84
  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 +9 -4
  49. data/assets/stylesheets/bootstrap/_labels.scss +1 -1
  50. data/assets/stylesheets/bootstrap/_list-group.scss +30 -26
  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 +11 -9
  54. data/assets/stylesheets/bootstrap/_navbar.scss +76 -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 -59
  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 +45 -22
  68. data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
  69. data/assets/stylesheets/bootstrap/_tooltip.scss +42 -33
  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 +47 -36
  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: 32b77fd9e1906f3c9c2d9b4819fae6ee15f291b3
4
- data.tar.gz: 0a0bb52c925c2c43fa3fe7a64184156493d30343
2
+ SHA256:
3
+ metadata.gz: 58feea8410ac26aa16a8887d49c39915f01053fac4d547549f22ad09cca903a2
4
+ data.tar.gz: ab2888314daa99c23c67034bb52e89cab7ad5c80fc94cafa2aa000964e6ac4a6
5
5
  SHA512:
6
- metadata.gz: 6ada02fc5158ee8beb009391175d43ce0c40b67267e8ae6a2f7ce040787a94d4a472ec7c403f699fc06b485b04fd8dfbf0c1a10170f55877bf24fa3c3c469d0f
7
- data.tar.gz: 0923525f442847a27649b0b69281dcf79a6972f1ae7a0261a028301c20836eafd2358d20b7e671f99868ea25d0dfee5f07f59fba9f56746976be5994518b1b0a
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,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
- 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.1'
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,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 `.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.
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|woff)$)
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 = [10, ::Sass::Script::Number.precision].max
89
+ ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
73
90
  ```
74
91
 
75
- Replace Bootstrap `@import` statements in `application.css.scss` with:
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. Compass without Rails
114
+ ### b. Bower
98
115
 
99
- Install the gem
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
- $ bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
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 `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).
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 bootstrap into like so:
129
+ If you use [mincer][mincer] with node-sass, import Bootstrap like so:
153
130
 
154
- In `application.css.ejs.scss` (NB **.css.ejs.css**):
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
- #### Sass
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
- #### Sass: Number Precision
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 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).
189
171
 
190
- Precision is set for Rails and Compass automatically.
191
- 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:
192
174
 
193
175
  ```ruby
194
- ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
176
+ ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
195
177
  ```
196
178
 
197
- 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.
198
-
199
-
200
- #### Sass: Autoprefixer
201
-
202
- Using [Autoprefixer][autoprefixer] with Bootstrap is recommended.
203
- [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
+ ```
204
197
 
205
- #### JavaScript
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
- #### Fonts
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.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!
251
244
 
252
245
  ```scss
253
246
  @import "bootstrap";
254
247
  ```
255
248
 
256
- You can also include optional bootstrap theme:
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 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.:
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
- `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 |
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 bootstrap LESS files to its matching SCSS file.
304
- * 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`.
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](http://diasporaproject.org/), [rails_admin](https://github.com/sferik/rails_admin),
326
- Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://gitlabhq.com/) and
327
- [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/).
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]: http://getbootstrap.com/javascript/#transitions
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/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