bootstrap-sass 2.3.1.3 → 3.0.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG.md +104 -0
  5. data/CONTRIBUTING.md +79 -0
  6. data/Gemfile +3 -0
  7. data/README.md +114 -78
  8. data/Rakefile +48 -0
  9. data/bootstrap-sass.gemspec +28 -0
  10. data/lib/bootstrap-sass/engine.rb +4 -2
  11. data/lib/bootstrap-sass/version.rb +4 -0
  12. data/lib/bootstrap-sass.rb +10 -5
  13. data/tasks/converter.rb +829 -0
  14. data/templates/project/_variables.scss.erb +3 -0
  15. data/templates/project/manifest.rb +10 -13
  16. data/templates/project/styles.scss +1 -6
  17. data/test/compass_test.rb +8 -0
  18. data/test/compilation_test.rb +13 -0
  19. data/test/dummy/README.rdoc +3 -0
  20. data/test/dummy/Rakefile +6 -0
  21. data/test/dummy/app/assets/images/.keep +0 -0
  22. data/test/dummy/app/assets/javascripts/application.js +2 -0
  23. data/test/dummy/app/assets/stylesheets/application.css.sass +1 -0
  24. data/test/dummy/app/controllers/application_controller.rb +5 -0
  25. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  26. data/test/dummy/app/helpers/application_helper.rb +2 -0
  27. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/test/dummy/app/views/pages/root.html.slim +11 -0
  29. data/test/dummy/bin/bundle +3 -0
  30. data/test/dummy/bin/rails +4 -0
  31. data/test/dummy/bin/rake +4 -0
  32. data/test/dummy/config/application.rb +17 -0
  33. data/test/dummy/config/boot.rb +5 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +26 -0
  36. data/test/dummy/config/environments/production.rb +76 -0
  37. data/test/dummy/config/environments/test.rb +30 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +5 -0
  42. data/test/dummy/config/initializers/secret_token.rb +18 -0
  43. data/test/dummy/config/initializers/session_store.rb +3 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/test/dummy/config/locales/en.yml +3 -0
  46. data/test/dummy/config/locales/es.yml +3 -0
  47. data/test/dummy/config/routes.rb +3 -0
  48. data/test/dummy/config.ru +4 -0
  49. data/test/dummy/db/test.sqlite3 +0 -0
  50. data/test/dummy/lib/assets/.keep +0 -0
  51. data/test/dummy/log/.keep +0 -0
  52. data/test/dummy/log/development.log +0 -0
  53. data/test/dummy/public/404.html +58 -0
  54. data/test/dummy/public/422.html +58 -0
  55. data/test/dummy/public/500.html +57 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/gemfiles/sass_3_2.gemfile +5 -0
  58. data/test/gemfiles/sass_head.gemfile +6 -0
  59. data/test/pages_test.rb +14 -0
  60. data/test/support/integration_test.rb +29 -0
  61. data/test/test_helper.rb +32 -0
  62. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  63. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +228 -0
  64. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  65. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  66. data/vendor/assets/javascripts/bootstrap/affix.js +126 -0
  67. data/vendor/assets/javascripts/bootstrap/alert.js +98 -0
  68. data/vendor/assets/javascripts/bootstrap/button.js +109 -0
  69. data/vendor/assets/javascripts/bootstrap/carousel.js +217 -0
  70. data/vendor/assets/javascripts/bootstrap/collapse.js +179 -0
  71. data/vendor/assets/javascripts/bootstrap/dropdown.js +154 -0
  72. data/vendor/assets/javascripts/bootstrap/modal.js +246 -0
  73. data/vendor/assets/javascripts/bootstrap/popover.js +117 -0
  74. data/vendor/assets/javascripts/bootstrap/scrollspy.js +158 -0
  75. data/vendor/assets/javascripts/bootstrap/tab.js +135 -0
  76. data/vendor/assets/javascripts/bootstrap/tooltip.js +386 -0
  77. data/vendor/assets/javascripts/bootstrap/transition.js +56 -0
  78. data/vendor/assets/javascripts/bootstrap.js +12 -13
  79. data/vendor/assets/stylesheets/bootstrap/_alerts.scss +46 -58
  80. data/vendor/assets/stylesheets/bootstrap/_badges.scss +51 -0
  81. data/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss +8 -9
  82. data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +173 -154
  83. data/vendor/assets/stylesheets/bootstrap/_buttons.scss +97 -165
  84. data/vendor/assets/stylesheets/bootstrap/_carousel.scss +116 -65
  85. data/vendor/assets/stylesheets/bootstrap/_close.scss +11 -8
  86. data/vendor/assets/stylesheets/bootstrap/_code.scss +16 -21
  87. data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +10 -3
  88. data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +103 -146
  89. data/vendor/assets/stylesheets/bootstrap/_forms.scss +222 -559
  90. data/vendor/assets/stylesheets/bootstrap/_glyphicons.scss +232 -0
  91. data/vendor/assets/stylesheets/bootstrap/_grid.scss +336 -11
  92. data/vendor/assets/stylesheets/bootstrap/_input-groups.scss +127 -0
  93. data/vendor/assets/stylesheets/bootstrap/_jumbotron.scss +40 -0
  94. data/vendor/assets/stylesheets/bootstrap/_labels.scss +58 -0
  95. data/vendor/assets/stylesheets/bootstrap/_list-group.scss +90 -0
  96. data/vendor/assets/stylesheets/bootstrap/_media.scss +8 -7
  97. data/vendor/assets/stylesheets/bootstrap/_mixins.scss +470 -430
  98. data/vendor/assets/stylesheets/bootstrap/_modals.scss +103 -52
  99. data/vendor/assets/stylesheets/bootstrap/_navbar.scss +511 -383
  100. data/vendor/assets/stylesheets/bootstrap/_navs.scss +169 -349
  101. data/vendor/assets/stylesheets/bootstrap/_normalize.scss +396 -0
  102. data/vendor/assets/stylesheets/bootstrap/_pager.scss +45 -33
  103. data/vendor/assets/stylesheets/bootstrap/_pagination.scss +65 -105
  104. data/vendor/assets/stylesheets/bootstrap/_panels.scss +148 -0
  105. data/vendor/assets/stylesheets/bootstrap/_popovers.scss +51 -51
  106. data/vendor/assets/stylesheets/bootstrap/_print.scss +100 -0
  107. data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +28 -55
  108. data/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss +180 -45
  109. data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +101 -24
  110. data/vendor/assets/stylesheets/bootstrap/_tables.scss +169 -168
  111. data/vendor/assets/stylesheets/bootstrap/_theme.scss +232 -0
  112. data/vendor/assets/stylesheets/bootstrap/_thumbnails.scss +11 -33
  113. data/vendor/assets/stylesheets/bootstrap/_tooltip.scss +45 -20
  114. data/vendor/assets/stylesheets/bootstrap/_type.scss +101 -110
  115. data/vendor/assets/stylesheets/bootstrap/_utilities.scss +19 -22
  116. data/vendor/assets/stylesheets/bootstrap/_variables.scss +498 -179
  117. data/vendor/assets/stylesheets/bootstrap/_wells.scss +7 -7
  118. data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +29 -33
  119. metadata +226 -44
  120. data/templates/project/_variables.scss +0 -301
  121. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  122. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  123. data/vendor/assets/javascripts/bootstrap-affix.js +0 -117
  124. data/vendor/assets/javascripts/bootstrap-alert.js +0 -99
  125. data/vendor/assets/javascripts/bootstrap-button.js +0 -105
  126. data/vendor/assets/javascripts/bootstrap-carousel.js +0 -207
  127. data/vendor/assets/javascripts/bootstrap-collapse.js +0 -167
  128. data/vendor/assets/javascripts/bootstrap-dropdown.js +0 -165
  129. data/vendor/assets/javascripts/bootstrap-modal.js +0 -247
  130. data/vendor/assets/javascripts/bootstrap-popover.js +0 -114
  131. data/vendor/assets/javascripts/bootstrap-scrollspy.js +0 -162
  132. data/vendor/assets/javascripts/bootstrap-tab.js +0 -144
  133. data/vendor/assets/javascripts/bootstrap-tooltip.js +0 -361
  134. data/vendor/assets/javascripts/bootstrap-transition.js +0 -60
  135. data/vendor/assets/javascripts/bootstrap-typeahead.js +0 -335
  136. data/vendor/assets/stylesheets/bootstrap/_accordion.scss +0 -34
  137. data/vendor/assets/stylesheets/bootstrap/_hero-unit.scss +0 -25
  138. data/vendor/assets/stylesheets/bootstrap/_labels-badges.scss +0 -83
  139. data/vendor/assets/stylesheets/bootstrap/_layouts.scss +0 -16
  140. data/vendor/assets/stylesheets/bootstrap/_reset.scss +0 -216
  141. data/vendor/assets/stylesheets/bootstrap/_responsive-1200px-min.scss +0 -28
  142. data/vendor/assets/stylesheets/bootstrap/_responsive-767px-max.scss +0 -193
  143. data/vendor/assets/stylesheets/bootstrap/_responsive-768px-979px.scss +0 -19
  144. data/vendor/assets/stylesheets/bootstrap/_responsive-navbar.scss +0 -189
  145. data/vendor/assets/stylesheets/bootstrap/_sprites.scss +0 -197
  146. data/vendor/assets/stylesheets/bootstrap/responsive.scss +0 -48
  147. data/vendor/assets/stylesheets/bootstrap-responsive.scss +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b09f6433158e12d5a8c8969da1e32985d51fb9ff
4
- data.tar.gz: e71e02077ea33385b244bb0fb151e22c8eda48f2
3
+ metadata.gz: f1e4cbf951a9a343944ac462a39d6b43bebfc6ec
4
+ data.tar.gz: b62ae642dcf8ab632639863c06ba4a780de0f182
5
5
  SHA512:
6
- metadata.gz: aae41147f24d99bcdeb4f94d23666e882c9ea47e51584c6c31920f2b715ebf0b8b435c02096912116a6d43d647255eafcf3f7c457bbe3bdb3d14937bb0618382
7
- data.tar.gz: c3a340f53d15c452268a1da849d3f5bf99ecd95e2effbb25b8564588c1448dcffdc896e26130f9f8eb9f03b21bdb99b54b6c02b5e35a6d8bbe971f5999fe8403
6
+ metadata.gz: d0a03a10a35d447a05d4be0b408d130667660bd6883b115c8f1c104bedfb0763b81539de9de31d64007cb14c9da376116e0b1d6d5005bb89951d7d44fefae60d
7
+ data.tar.gz: 5c054a06f4bae587b0565b892181a607c2bd155afa53be377e5c89f4a676ddc57d3d920d29e22aa07b614c85ac6752ac3f78c805fab8e8a3f7c6851dfa987a68
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ *.gem
2
+ .sass-cache
3
+ bootstrap.css
4
+ bootstrap-responsive.css
5
+ Gemfile.lock
6
+ .rvmrc
7
+ .rbenv-version
8
+
9
+ # Ignore bundler config
10
+ /.bundle
11
+ /vendor/cache
12
+ /vendor/bundle
13
+ tmp/
14
+ test/screenshots/
15
+ test/dummy/log/test.log
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - jruby
6
+ - rbx-19mode
7
+ gemfile:
8
+ - test/gemfiles/sass_3_2.gemfile
9
+ - test/gemfiles/sass_head.gemfile
10
+ matrix:
11
+ allow_failures:
12
+ - gemfile: test/gemfiles/sass_head.gemfile
data/CHANGELOG.md ADDED
@@ -0,0 +1,104 @@
1
+ # Changelog
2
+
3
+ ## 3.0.0.0
4
+
5
+ * Fully automated (lots of string juggling) LESS -> Sass conversion. - *Gleb Mazovetskiy*
6
+ * Ported rake task from vwall/compass-twitter-bootstrap to convert Bootstrap upstream - *Peter Gumeson*
7
+ * Moved javascripts to us `bootstrap-component.js` to `bootstrap/component.js` - *Peter Gumeson*
8
+
9
+ ## 2.3.2.2
10
+
11
+ * Allow sass-rails `>= 3.2` - *Thomas McDonald*
12
+
13
+ ## 2.3.2.1
14
+
15
+ ## 2.3.2.0
16
+
17
+ * Update to Bootstrap 2.3.2 - *Dan Allen*
18
+
19
+ ## 2.3.1.3
20
+
21
+ * Find the correct Sprockets context for the `image_path` function - *Tristan Harward, Gleb Mazovetskiy*
22
+
23
+ ## 2.3.1.2
24
+
25
+ * Fix changes to image url - *Gleb Mazovetskiy*
26
+ * Copy _variables into project on Compass install - *Phil Thompson*
27
+ * Add `bootstrap-affix` to the Compass template file - *brief*
28
+
29
+ ## 2.3.1.1 (yanked)
30
+
31
+ * Change how image_url is handled internally - *Tristan Harward*
32
+ * Fix some font variables not having `!default` - *Thomas McDonald*
33
+
34
+ ## 2.3.0.0
35
+ * [#290] Update to Bootstrap 2.3.0 - *Tristan Harward*
36
+ * Fix `rake:debug` with new file locations - *Thomas McDonald*
37
+ * Add draft contributing document - *Thomas McDonald*
38
+ * [#260] Add our load path to the global Sass load path - *Tristan Harward*
39
+ * [#275] Use GitHub notation in Sass head testing gemfile - *Timo Schilling*
40
+ * [#279, #283] Readme improvements - *theverything, Philip Arndt*
41
+
42
+ ## 2.2.2.0
43
+ * [#270] Update to Bootstrap 2.2.2 - *Tristan Harward*
44
+ * [#266] Add license to gemspec - *Peter Marsh*
45
+
46
+ ## 2.2.1.1
47
+ * [#258] Use `bootstrap` prefix for `@import`ing files in `bootstrap/bootstrap.scss` - *Umair Siddique*
48
+
49
+ ## 2.2.1.0
50
+ * [#246] Update to Bootstrap 2.2.1 - *Tristan Harward*
51
+ * [#246] Pull Bootstrap updates from jlong/sass-twitter-bootstrap - *Tristan Harward*
52
+
53
+ ## 2.1.1.0
54
+ * Update to Bootstrap 2.1.1
55
+ * [#222] Remove 100% multiplier in vertical-three-colours
56
+ * [#227] Fix IE component animation collapse
57
+ * [#228] Fix variables documentation link
58
+ * [#231] Made .input-block-level a class as well as mixin
59
+
60
+ ## 2.1.0.1
61
+ * [#219] Fix expected a color. Got: transparent.
62
+ * [#207] Add missing warning style for table row highlighting
63
+ * [#208] Use grid-input-span for input spans
64
+
65
+ ## 2.1.0.0
66
+ * Updated to Bootstrap 2.1
67
+ * Changed some mixin names to be more consistent. Nested mixins in Less are separated by a `-` when they are flattened in Sass.
68
+
69
+ ## 2.0.4.1
70
+ * Fix `.row-fluid > spanX` nesting
71
+ * Small Javascript fixes for those staying on the 2.0.4 release
72
+ * Add `!default` to z-index variables.
73
+
74
+ ## 2.0.4.0
75
+ * Updated to Bootstrap 2.0.4
76
+ * Switched to Bootstrap 2.0.3+'s method of separating responsive files
77
+ * [#149, #150] Fix off by one error introduced with manual revert of media query breakpoints
78
+ * `rake debug` and `rake test` both compile bootstrap & bootstrap-responsive
79
+
80
+ ## 2.0.3.1
81
+ * [#145, #146] Fix button alignment in collapsing navbar as a result of an incorrect variable
82
+
83
+ ## 2.0.3
84
+ * Updated to Bootstrap 2.0.3
85
+ * [#106] Support for Rails < 3.1 through Compass
86
+ * [#132] Add CI testing
87
+ * [#106] Support Rails w/Compass
88
+ * [#134] Fix support for Rails w/Compass
89
+
90
+ ## 2.0.2
91
+ * [#86] Updated to Bootstrap 2.0.2
92
+ Things of note: static navbars now have full width. (to be fixed in 2.0.3) `.navbar-inner > .container { width:940px; }` seems to work in the meanwhile
93
+ * [#62] Fixed asset compilation taking a *very* long time.
94
+ * [#69, #79, #80] \(Hopefully) clarified README. Now with less cat humour.
95
+ * [#91] Removed doubled up Sass extensions for Rails.
96
+ * [#63, #73] Allow for overriding of image-path
97
+ * [[SO](http://stackoverflow.com/a/9909626/241212)] Added makeFluidColumn mixin for defining fluid columns. Fluid rows must use `@extend .row-fluid`, and any column inside it can use `@include makeFluidColumn(num)`, where `num` is the number of columns. Unfortunately, there is a rather major limitation to this: margins on first-child elements must be overriden. See the attached Stack Overflow answer for more information.
98
+
99
+ ## 2.0.1
100
+ * Updated to Bootstrap 2.0.1
101
+ * Modified `@mixin opacity()` to take an argument `0...1` rather than `0...100` to be consistent with Compass.
102
+
103
+ ## 2.0.0
104
+ * Updated to Bootstrap 2.0.0
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,79 @@
1
+ # Contributing to bootstrap-sass
2
+
3
+ ## Asset Changes
4
+
5
+ Any changes to `bootstrap-sass` assets (scss, javascripts, fonts) should be checked against the `convert` rake task.
6
+ For usage instructions, see the [README](https://github.com/thomas-mcdonald/bootstrap-sass/blob/3/README.md).
7
+
8
+ If something is broken in the converter, it's preferable to update the converter along with the asset itself.
9
+
10
+
11
+ ## Bugs
12
+
13
+ A bug is a _demonstrable problem_ that is caused by the code in the
14
+ repository. Good bug reports are extremely helpful - thank you!
15
+
16
+ Guidelines for bug reports:
17
+
18
+ 1. **Does it belong here?** &mdash; is this a problem with bootstrap-sass, or
19
+ it an issue with [twbs/bootstrap](https://github.com/twbs/bootstrap)?
20
+ We only distribute a direct port and will not modify files if they're not
21
+ changed upstream.
22
+
23
+ 2. **Use the GitHub issue search** &mdash; check if the issue has already been
24
+ reported.
25
+
26
+ 3. **Isolate the problem** &mdash; ideally create a [reduced test
27
+ case](http://css-tricks.com/6263-reduced-test-cases/) and a live example.
28
+
29
+ A good bug report shouldn't leave others needing to chase you up for more
30
+ information. Please try to be as detailed as possible in your report. What is
31
+ your environment? What steps will reproduce the issue? What browser(s) and OS
32
+ experience the problem? What would you expect to be the outcome? All these
33
+ details will help people to fix any potential bugs.
34
+
35
+ Example:
36
+
37
+ > Short and descriptive example bug report title
38
+ >
39
+ > A summary of the issue and the browser/OS environment in which it occurs. If
40
+ > suitable, include the steps required to reproduce the bug.
41
+ >
42
+ > 1. This is the first step
43
+ > 2. This is the second step
44
+ > 3. Further steps, etc.
45
+ >
46
+ > `<url>` (a link to the reduced test case)
47
+ >
48
+ > Any other information you want to share that is relevant to the issue being
49
+ > reported. This might include the lines of code that you have identified as
50
+ > causing the bug, and potential solutions (and your opinions on their
51
+ > merits).
52
+
53
+ **[File a bug report](https://github.com/thomas-mcdonald/bootstrap-sass/issues/)**
54
+
55
+
56
+ ## Pull requests
57
+
58
+ **We will not accept pull requests that modify the SCSS beyond fixing bugs caused by *our* code!**
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)
61
+
62
+ Good pull requests - patches, improvements, new features - are a fantastic
63
+ help. They should remain focused in scope and avoid containing unrelated
64
+ commits. If your contribution involves a significant amount of work or substantial
65
+ changes to any part of the project, please open an issue to discuss it first.
66
+
67
+ Make sure to adhere to the coding conventions used throughout a project
68
+ (indentation, accurate comments, etc.). Please update any documentation that is
69
+ relevant to the change you're making.
70
+
71
+ ## Do not…
72
+
73
+ Please **do not** use the issue tracker for personal support requests (use
74
+ [Stack Overflow](http://stackoverflow.com/)).
75
+
76
+ Please **do not** derail or troll issues. Keep the
77
+ discussion on topic and respect the opinions of others.
78
+
79
+ *props [html5-boilerplate](https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md)*
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/README.md CHANGED
@@ -1,135 +1,171 @@
1
1
  # Bootstrap for Sass
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/thomas-mcdonald/bootstrap-sass.png?branch=master)](http://travis-ci.org/thomas-mcdonald/bootstrap-sass)
3
+ [![Build Status](https://secure.travis-ci.org/thomas-mcdonald/bootstrap-sass.png?branch=master)](http://travis-ci.org/thomas-mcdonald/bootstrap-sass) [![Code Climate](https://codeclimate.com/github/thomas-mcdonald/bootstrap-sass.png)](https://codeclimate.com/github/thomas-mcdonald/bootstrap-sass)
4
4
 
5
- `bootstrap-sass` is an Sass-powered version of [Twitter's Bootstrap](http://github.com/twitter/bootstrap), ready to drop right into your Sass powered applications.
5
+ `bootstrap-sass` is an Sass-powered version of [Bootstrap](http://github.com/twbs/bootstrap), ready to drop right into your Sass powered applications.
6
6
 
7
- Enjoy.
7
+ ## Installation
8
8
 
9
- ## Usage
9
+ Please see the appropriate guide for your environment of choice:
10
+
11
+ ### a. Rails
10
12
 
11
- ### Rails
13
+ `bootstrap-sass` is easy to drop into Rails with the asset pipeline.
12
14
 
13
- In your Gemfile:
15
+ In your Gemfile you need to add the `bootstrap-sass` gem, and ensure that the `sass-rails` gem is present - it is added to new Rails applications by default.
14
16
 
15
17
  ```ruby
16
- gem 'sass-rails', '~> 3.2'
17
- gem 'bootstrap-sass', '~> 2.3.1.3'
18
+ gem 'sass-rails', '>= 3.2' # sass-rails needs to be higher than 3.2
19
+ gem 'bootstrap-sass', '~> 3.0.0.0.rc'
18
20
  ```
19
21
 
20
- `bundle install` and restart your server to make the files available.
22
+ `bundle install` and restart your server to make the files available through the pipeline.
21
23
 
22
- #### Rails 4
24
+ ### b. Compass (no Rails)
23
25
 
24
- Due to a change in Rails that prevents images from being compiled in vendor and lib, you'll need to add the following line to your application.rb:
26
+ Install the gem
27
+ ```console
28
+ gem install bootstrap-sass --pre
29
+ ```
25
30
 
26
- config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
31
+ If you have an existing Compass project:
27
32
 
28
- #### CSS
33
+ ```ruby
34
+ # config.rb:
35
+ require 'bootstrap-sass'
36
+ ```
29
37
 
30
- Import Bootstrap in an SCSS file (for example, `application.css.scss`) to get all of Bootstrap's styles, mixins and variables! We recommend against using `//= require` directives, since none of your other stylesheets will be [able to use](https://github.com/thomas-mcdonald/bootstrap-sass/issues/79#issuecomment-4428595) the awesome mixins that Bootstrap has defined.
38
+ ```console
39
+ compass install bootstrap
40
+ ```
31
41
 
32
- ```css
33
- @import "bootstrap";
42
+ If you are creating a new Compass project, you can generate it with bootstrap-sass support:
43
+
44
+ ```console
45
+ compass create my-new-project -r bootstrap-sass --using bootstrap
34
46
  ```
35
47
 
36
- #### Javascripts
48
+ This will create a new Compass project with the following files in it:
37
49
 
38
- You can include the Bootstrap javascripts through two methods. In this case, Sprocket's `//= require` directives are useful, since there is no better alternative.
50
+ * [_variables.scss](/templates/project/_variables.scss.erb) - all of bootstrap variables (override them here).
51
+ * [styles.scss](/templates/project/styles.scss) - main project SCSS file, import `variables` and `bootstrap`.
39
52
 
40
- We have a helper that includes all available javascripts:
41
53
 
42
- ```js
43
- // Loads all Bootstrap javascripts
44
- //= require bootstrap
45
- ```
54
+ ## Usage
46
55
 
47
- You can also load individual modules, provided you sort out any related dependencies.
56
+ ### CSS / SCSS / SASS
48
57
 
49
- ```js
50
- //= require bootstrap-scrollspy
51
- //= require bootstrap-modal
52
- //= require bootstrap-dropdown
58
+ Import Bootstrap in an SCSS file (for example, `application.css.scss`) to get all of Bootstrap's styles, mixins and variables! We recommend against using `//= require` directives, since none of your other stylesheets will be [able to access][antirequire] the Bootstrap mixins or variables.
59
+
60
+ ```css
61
+ @import "bootstrap";
53
62
  ```
54
63
 
55
- Simples.
64
+ You can also include optional bootstrap theme:
56
65
 
57
- ### Compass
66
+ ```css
67
+ @import "bootstrap/theme";
68
+ ```
58
69
 
59
- `bootstrap-sass` 2.0 now comes with support for Compass, meaning projects that don't use Rails can get in on the fun Bootstrap web.
70
+ 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.
71
+ For example:
72
+ ```css
73
+ $navbar-default-bg: #312312;
74
+ $light-orange: #ff8c00;
75
+ $navbar-default-color: $light-orange;
60
76
 
61
- #### New project
77
+ @import "bootstrap";
78
+ ```
62
79
 
63
- Install the gem and create a new project using the gem.
80
+ For granular control over what is imported, instead of `@import "bootstrap"`, explicitly specify which modules and components should be included.
64
81
 
65
- ```console
66
- gem install bootstrap-sass
67
- compass create compass-test -r bootstrap-sass --using bootstrap
82
+ Copy `bootstrap.scss` from the gem into the project's vendor/ as `bootstrap-custom.scss`.
83
+
84
+ ```bash
85
+ cp $(bundle show bootstrap-sass)/vendor/assets/stylesheets/bootstrap/bootstrap.scss \
86
+ vendor/assets/stylesheets/bootstrap-custom.scss
68
87
  ```
69
88
 
70
- This will sort a few things out:
89
+ Comment out the import statements you do not need from `bootstrap-custom.scss`.
71
90
 
72
- * You'll get a starting `styles.scss` ready for your alterations
73
- * You'll get a compiled stylesheet compiled & ready to drop into your application
74
- * We'll also copy the Bootstrap javascripts & images into their respective folders for you, absolutely free of charge! How cool is that?
91
+ Finally, in your `application.sass`:
75
92
 
76
- #### Existing project
93
+ ```scss
94
+ @import 'bootstrap-custom';
95
+ ```
77
96
 
78
- Install the gem, add the require statement to the top of your configuration file, and install the extension.
97
+ NB: This file now needs to be manually kept up to date with structural changes from upstream.
79
98
 
80
- ```console
81
- gem install bootstrap-sass
82
- ```
99
+ ### Javascript
83
100
 
84
- ```ruby
85
- # In config.rb
86
- require 'bootstrap-sass'
101
+ We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately),
102
+ put this in your Javascript manifest (usually in `application.js`) to load the files in the [correct order](/vendor/assets/javascripts/bootstrap.js):
103
+
104
+ ```js
105
+ // Loads all Bootstrap javascripts
106
+ //= require bootstrap
87
107
  ```
88
108
 
89
- ```console
90
- compass install bootstrap
109
+ You can also load individual modules, provided you also require any dependencies. You can check dependencies in the [Bootstrap JS documentation][jsdocs].
110
+
111
+ ```js
112
+ //= require bootstrap/scrollspy
113
+ //= require bootstrap/modal
114
+ //= require bootstrap/dropdown
91
115
  ```
92
116
 
93
- You'll get the same benefits as those starting from scratch. Radical.
117
+ ## Development and Contributing
94
118
 
95
- ## Configuration
96
- Need to configure a variable or two? Simply define the value of the variable you want to change *before* importing Bootstrap. Sass will respect your existing definition rather than overwriting it with the Bootstrap defaults. A list of customisable variables can be found in the [Bootstrap documentation](http://twitter.github.com/bootstrap/customize.html#variables).
119
+ If you'd like to help with the development of bootstrap-sass itself, read this section.
97
120
 
98
- ```scss
99
- $btnPrimaryBackground: #f00;
100
- @import "bootstrap";
101
- ```
121
+ ### Upstream Converter
102
122
 
103
- **Note**: It's important that the file you are importing is not named `bootstrap`, since this will cause an import loop. As a general rule, errors are something you should try to avoid.
123
+ Keeping bootstrap-sass in sync with upstream changes from Bootstrap used to be an error prone and time consuming manual process. With Bootstrap 3 we have introduced a converter that automates this.
104
124
 
105
- ### Passing multiple values to mixins
125
+ **Note: if you're just looking to *use* Bootstrap 3, see the [installation](#installation) section above.**
106
126
 
107
- Some CSS3 properties take multiple values, such as `box-shadow` or `text-shadow`. To pass multiple values to the Bootstrap mixins, you must escape the values or else the Sass parser will choke on the commas. Here's how to escape the values in Sass:
127
+ Upstream changes to the Bootstrap project can now be pulled in using the `convert` rake task.
108
128
 
109
- ```scss
110
- .selector {
111
- @include box-shadow(#{0 2px 5px rgba(0,0,0,.25) inset, 0 -2px 5px rgba(0,0,0,.25) inset});
112
- }
113
- ```
129
+ Here's an example run that would pull down the master branch from the main [twbs/bootstrap](https://github.com/twbs/bootstrap) repo:
130
+
131
+ rake convert
132
+
133
+ This will convert the latest LESS to SASS and update to the latest JS.
134
+ To convert a specific branch or version, pass the branch name or the commit hash as the first task argument:
135
+
136
+ rake convert[e8a1df5f060bf7e6631554648e0abde150aedbe4]
114
137
 
115
- ### Responsive styling?
116
- As per the Bootstrap project we don't include the responsive styles by default. `@import "bootstrap-responsive";` to get them.
138
+ The latest converter script is located [here][converter] and does the following:
117
139
 
118
- ## Versioning
119
- Bootstrap [claims](https://github.com/twitter/bootstrap#versioning) to use SemVer, although this is for values of public API that don't seem to include selectively requiring CSS components (see breaking change 2.0.2 -> 2.0.3). Since many people using bootstrap-sass *do* selectively require CSS components and I consider it part of the public API we can't really follow SemVer without becoming wildly out of sync with the Bootstrap version number, which is confusing for everyone involved. Further releases to bootstrap-sass will therefore have version numbers of the form `2.x.y.z`, where `2.x.y` is the release of Bootstrap we should be compatible with, and `z` is the patch version.
140
+ * Converts upstream bootstrap LESS files to its matching SCSS file.
141
+ * Copies all upstream JavaScript into `vendor/assets/javascripts/bootstrap`
142
+ * Generates a javascript manifest at `vendor/assets/javascripts/bootstrap.js`
143
+ * Copies all upstream font files into `vendor/assets/fonts/bootstrap`
144
+ * Sets `Bootstrap::BOOTSTRAP_SHA` in [version.rb][version] to the branch sha.
120
145
 
121
- Basically this means you should expect to append a separate patch version to the bootstrap version, which allows our versioning to stay more honest about changes.
146
+ This converter fully converts original LESS to SCSS. Conversion is automatic but requires instructions for certain transformations (see converter output).
147
+ Please submit GitHub issues tagged with `conversion`.
122
148
 
123
- ### Bundler?
149
+ ## Credits
124
150
 
125
- ```ruby
126
- gem 'bootstrap-sass', '~> 2.3.1.3'
127
- ```
151
+ bootstrap-sass has a number of major contributors:
128
152
 
129
- Don't use the standard `~> 2.x.y`. Your apps may break.
153
+ <!-- feel free to make these link wherever you wish -->
154
+ * [Thomas McDonald](https://twitter.com/thomasmcdonald_)
155
+ * [Tristan Harward](http://www.trisweb.com)
156
+ * Peter Gumeson
157
+ * [Gleb Mazovetskiy](https://github.com/glebm)
130
158
 
131
- ## Who
132
- bootstrap-sass is a project by [Thomas McDonald](https://twitter.com/#!/thomasmcdonald_), with support from [other awesome people](https://github.com/thomas-mcdonald/bootstrap-sass/graphs/contributors).
159
+ and a [significant number of other contributors][contrib].
133
160
 
134
161
  ## You're in good company
135
- bootstrap-sass is used to build some awesome projects, including [Diaspora](http://diasporaproject.org/), [rails_admin](https://github.com/sferik/rails_admin), Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://gitlabhq.com/) and [kandan](http://kandanapp.com/). Using bootstrap-sass? I'd love it if you let me know.
162
+ bootstrap-sass is used to build some awesome projects all over the web, including
163
+ [Diaspora](http://diasporaproject.org/), [rails_admin](https://github.com/sferik/rails_admin),
164
+ Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://gitlabhq.com/) and
165
+ [kandan](http://kandanapp.com/).
166
+
167
+ [converter]: https://github.com/thomas-mcdonald/bootstrap-sass/blob/3/tasks/converter.rb
168
+ [version]: https://github.com/thomas-mcdonald/bootstrap-sass/blob/3/lib/bootstrap-sass/version.rb
169
+ [contrib]: https://github.com/thomas-mcdonald/bootstrap-sass/graphs/contributors
170
+ [antirequire]: https://github.com/thomas-mcdonald/bootstrap-sass/issues/79#issuecomment-4428595
171
+ [jsdocs]: http://getbootstrap.com/javascript/#transitions
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'rake/testtask'
2
+ Rake::TestTask.new do |t|
3
+ t.libs << "test"
4
+ t.test_files = FileList['test/*_test.rb']
5
+ t.verbose = true
6
+ end
7
+
8
+ desc 'Dumps output to a CSS file for testing'
9
+ task :debug do
10
+ require 'sass'
11
+ require './lib/bootstrap-sass/compass_functions'
12
+ require './lib/bootstrap-sass/sass_functions'
13
+ path = './vendor/assets/stylesheets'
14
+ %w(bootstrap).each do |file|
15
+ engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
16
+ File.open("./#{file}.css", 'w') { |f| f.write(engine.render) }
17
+ end
18
+ end
19
+
20
+ desc 'Convert bootstrap to bootstrap-sass'
21
+ task :convert, :branch do |t, args|
22
+ require './tasks/converter'
23
+ branch = args[:branch]
24
+ Converter.new(branch).process
25
+ end
26
+
27
+ desc 'Compile bootstrap-sass to tmp/ (or first arg)'
28
+ task :compile, :css_path do |t, args|
29
+ lib_path = File.join(File.dirname(__FILE__), 'lib')
30
+ $:.unshift(lib_path) unless $:.include?(lib_path)
31
+ require 'sass'
32
+ require 'bootstrap-sass/compass_functions'
33
+ require 'bootstrap-sass/sass_functions'
34
+ require 'term/ansicolor'
35
+
36
+ path = 'vendor/assets/stylesheets'
37
+ puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
38
+ %w(bootstrap bootstrap/_theme).each do |file|
39
+ save_path = "#{args.with_defaults(css_path: 'tmp')[:css_path]}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
40
+ puts Term::ANSIColor.cyan(" #{save_path}") + '...'
41
+ engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
42
+ css = engine.render
43
+ File.mkdir('tmp') unless File.directory?('tmp')
44
+ File.open(save_path, 'w') { |f| f.write css }
45
+ end
46
+ end
47
+
48
+ task default: :test
@@ -0,0 +1,28 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'bootstrap-sass/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "bootstrap-sass"
7
+ s.version = Bootstrap::VERSION
8
+ s.authors = ["Thomas McDonald"]
9
+ s.email = 'tom@conceptcoding.co.uk'
10
+ s.summary = "Twitter's Bootstrap, converted to Sass and ready to drop into Rails or Compass"
11
+ s.homepage = "http://github.com/thomas-mcdonald/bootstrap-sass"
12
+ s.license = "Apache 2.0"
13
+
14
+ s.add_development_dependency 'compass'
15
+ s.add_development_dependency 'term-ansicolor'
16
+ s.add_development_dependency 'sass-rails', '>= 3.2'
17
+ s.add_runtime_dependency 'sass', '~> 3.2'
18
+
19
+
20
+ s.add_development_dependency 'capybara'
21
+ s.add_development_dependency 'poltergeist'
22
+ s.add_development_dependency 'tzinfo'
23
+ s.add_development_dependency 'jquery-rails'
24
+ s.add_development_dependency 'slim-rails'
25
+
26
+ s.files = `git ls-files`.split("\n")
27
+ s.test_files = `git ls-files -- test/*`.split("\n")
28
+ end
@@ -1,7 +1,9 @@
1
1
  module Bootstrap
2
2
  module Rails
3
3
  class Engine < ::Rails::Engine
4
- # Rails, will you please look in our vendor? kthx
4
+ initializer "bootstrap-sass.assets.precompile" do |app|
5
+ app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff)$)
6
+ end
5
7
  end
6
8
  end
7
- end
9
+ end
@@ -0,0 +1,4 @@
1
+ module Bootstrap
2
+ VERSION = '3.0.0.0'
3
+ BOOTSTRAP_SHA = 'e8a1df5f060bf7e6631554648e0abde150aedbe4'
4
+ end
@@ -15,12 +15,17 @@ module Bootstrap
15
15
  register_rails_engine
16
16
  end
17
17
 
18
- if !(rails? || compass?)
19
- raise Bootstrap::FrameworkNotFound, "bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded"
18
+ unless rails? || compass?
19
+ raise Bootstrap::FrameworkNotFound,
20
+ 'bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded'
21
+ end
22
+
23
+ bs_stylesheets = File.expand_path(File.join('..', 'vendor', 'assets', 'stylesheets'))
24
+ ::Sass.load_paths << bs_stylesheets
25
+ if ::Sass::Script::Number.precision < 10
26
+ # see https://github.com/thomas-mcdonald/bootstrap-sass/issues/409
27
+ ::Sass::Script::Number.precision = 10
20
28
  end
21
-
22
- stylesheets = File.expand_path(File.join("..", 'vendor', 'assets', 'stylesheets'))
23
- ::Sass.load_paths << stylesheets
24
29
  end
25
30
 
26
31
  private