bootstrap-sass 3.1.1.0 → 3.1.1.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 (132) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.travis.yml +5 -2
  4. data/Gemfile +4 -0
  5. data/README.md +41 -20
  6. data/Rakefile +5 -2
  7. data/bootstrap-sass.gemspec +10 -7
  8. data/bower.json +98 -2
  9. data/lib/bootstrap-sass.rb +0 -1
  10. data/lib/bootstrap-sass/version.rb +2 -2
  11. data/package.json +25 -0
  12. data/tasks/bower.rake +33 -0
  13. data/tasks/converter.rb +3 -1
  14. data/tasks/converter/less_conversion.rb +54 -35
  15. data/tasks/converter/network.rb +10 -7
  16. data/templates/project/_variables.sass.erb +6 -0
  17. data/templates/project/manifest.rb +2 -2
  18. data/templates/project/styles.sass +3 -0
  19. data/test/dummy_node_mincer/apple-touch-icon-144-precomposed.png +0 -0
  20. data/test/dummy_node_mincer/application.css.ejs.scss +6 -0
  21. data/test/dummy_node_mincer/manifest.js +87 -0
  22. data/test/{dummy → dummy_rails}/README.rdoc +0 -0
  23. data/test/{dummy → dummy_rails}/Rakefile +0 -0
  24. data/test/{dummy → dummy_rails}/app/assets/images/.keep +0 -0
  25. data/test/{dummy → dummy_rails}/app/assets/javascripts/application.js +0 -0
  26. data/test/{dummy → dummy_rails}/app/assets/stylesheets/application.css.sass +0 -0
  27. data/test/{dummy → dummy_rails}/app/controllers/application_controller.rb +0 -0
  28. data/test/{dummy → dummy_rails}/app/controllers/pages_controller.rb +0 -0
  29. data/test/{dummy → dummy_rails}/app/helpers/application_helper.rb +0 -0
  30. data/test/{dummy → dummy_rails}/app/views/layouts/application.html.erb +0 -0
  31. data/test/{dummy → dummy_rails}/app/views/pages/root.html.slim +0 -0
  32. data/test/{dummy → dummy_rails}/bin/bundle +0 -0
  33. data/test/{dummy → dummy_rails}/bin/rails +0 -0
  34. data/test/{dummy → dummy_rails}/bin/rake +0 -0
  35. data/test/{dummy → dummy_rails}/config.ru +0 -0
  36. data/test/{dummy → dummy_rails}/config/application.rb +3 -6
  37. data/test/{dummy → dummy_rails}/config/boot.rb +0 -0
  38. data/test/{dummy → dummy_rails}/config/environment.rb +0 -0
  39. data/test/{dummy → dummy_rails}/config/environments/development.rb +0 -0
  40. data/test/{dummy → dummy_rails}/config/environments/production.rb +0 -0
  41. data/test/{dummy → dummy_rails}/config/environments/test.rb +0 -0
  42. data/test/{dummy → dummy_rails}/config/initializers/backtrace_silencers.rb +0 -0
  43. data/test/{dummy → dummy_rails}/config/initializers/filter_parameter_logging.rb +0 -0
  44. data/test/{dummy → dummy_rails}/config/initializers/inflections.rb +0 -0
  45. data/test/{dummy → dummy_rails}/config/initializers/mime_types.rb +0 -0
  46. data/test/{dummy → dummy_rails}/config/initializers/secret_token.rb +0 -0
  47. data/test/{dummy → dummy_rails}/config/initializers/session_store.rb +0 -0
  48. data/test/{dummy → dummy_rails}/config/initializers/wrap_parameters.rb +0 -0
  49. data/test/{dummy → dummy_rails}/config/locales/en.yml +0 -0
  50. data/test/{dummy → dummy_rails}/config/locales/es.yml +0 -0
  51. data/test/{dummy → dummy_rails}/config/routes.rb +0 -0
  52. data/test/{dummy → dummy_rails}/db/test.sqlite3 +0 -0
  53. data/test/{dummy → dummy_rails}/lib/assets/.keep +0 -0
  54. data/test/{dummy → dummy_rails}/log/.keep +0 -0
  55. data/test/{dummy → dummy_rails}/public/404.html +0 -0
  56. data/test/{dummy → dummy_rails}/public/422.html +0 -0
  57. data/test/{dummy → dummy_rails}/public/500.html +0 -0
  58. data/test/{dummy → dummy_rails}/public/favicon.ico +0 -0
  59. data/test/gemfiles/sass_3_2.gemfile +3 -0
  60. data/test/gemfiles/sass_3_3.gemfile +17 -0
  61. data/test/gemfiles/sass_head.gemfile +5 -2
  62. data/test/node_mincer_test.rb +35 -0
  63. data/test/node_sass_test.rb +15 -0
  64. data/test/test_helper.rb +2 -2
  65. data/vendor/assets/javascripts/bootstrap/affix.js +2 -4
  66. data/vendor/assets/javascripts/bootstrap/carousel.js +5 -5
  67. data/vendor/assets/javascripts/bootstrap/collapse.js +18 -13
  68. data/vendor/assets/javascripts/bootstrap/dropdown.js +8 -8
  69. data/vendor/assets/javascripts/bootstrap/modal.js +43 -15
  70. data/vendor/assets/javascripts/bootstrap/popover.js +1 -1
  71. data/vendor/assets/javascripts/bootstrap/scrollspy.js +5 -4
  72. data/vendor/assets/javascripts/bootstrap/tooltip.js +64 -41
  73. data/vendor/assets/javascripts/bootstrap/transition.js +4 -4
  74. data/vendor/assets/stylesheets/_bootstrap-mincer.scss +17 -0
  75. data/vendor/assets/stylesheets/bootstrap.scss +3 -2
  76. data/vendor/assets/stylesheets/bootstrap/_badges.scss +13 -11
  77. data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +12 -2
  78. data/vendor/assets/stylesheets/bootstrap/_carousel.scss +12 -3
  79. data/vendor/assets/stylesheets/bootstrap/_code.scss +0 -1
  80. data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +10 -4
  81. data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +1 -0
  82. data/vendor/assets/stylesheets/bootstrap/_forms.scss +62 -20
  83. data/vendor/assets/stylesheets/bootstrap/_glyphicons.scss +4 -0
  84. data/vendor/assets/stylesheets/bootstrap/_jumbotron.scss +4 -0
  85. data/vendor/assets/stylesheets/bootstrap/_labels.scss +11 -9
  86. data/vendor/assets/stylesheets/bootstrap/_list-group.scss +19 -0
  87. data/vendor/assets/stylesheets/bootstrap/_mixins.scss +35 -943
  88. data/vendor/assets/stylesheets/bootstrap/_modals.scss +11 -3
  89. data/vendor/assets/stylesheets/bootstrap/_navbar.scss +40 -2
  90. data/vendor/assets/stylesheets/bootstrap/_normalize.scss +21 -19
  91. data/vendor/assets/stylesheets/bootstrap/_panels.scss +2 -3
  92. data/vendor/assets/stylesheets/bootstrap/_popovers.scss +1 -1
  93. data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +16 -7
  94. data/vendor/assets/stylesheets/bootstrap/_responsive-embed.scss +34 -0
  95. data/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss +99 -0
  96. data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +16 -0
  97. data/vendor/assets/stylesheets/bootstrap/_tables.scss +2 -2
  98. data/vendor/assets/stylesheets/bootstrap/_type.scss +16 -6
  99. data/vendor/assets/stylesheets/bootstrap/_variables.scss +26 -10
  100. data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +3 -2
  101. data/vendor/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  102. data/vendor/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  103. data/vendor/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  104. data/vendor/assets/stylesheets/bootstrap/mixins/_buttons.scss +50 -0
  105. data/vendor/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  106. data/vendor/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  107. data/vendor/assets/stylesheets/bootstrap/mixins/_forms.scss +84 -0
  108. data/vendor/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  109. data/vendor/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +87 -0
  110. data/vendor/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  111. data/vendor/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  112. data/vendor/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
  113. data/vendor/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  114. data/vendor/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  115. data/vendor/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  116. data/vendor/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  117. data/vendor/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  118. data/vendor/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  119. data/vendor/assets/stylesheets/bootstrap/mixins/_panels.scss +20 -0
  120. data/vendor/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +8 -0
  121. data/vendor/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  122. data/vendor/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  123. data/vendor/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  124. data/vendor/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  125. data/vendor/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  126. data/vendor/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  127. data/vendor/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  128. data/vendor/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  129. data/vendor/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +224 -0
  130. metadata +169 -136
  131. data/templates/project/_variables.scss.erb +0 -3
  132. data/templates/project/styles.scss +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e171234929f3be608f49681f95c6c7bb65b1c456
4
- data.tar.gz: ce73255af32c3ef18b3f2cc91fe9034276fc5f6b
3
+ metadata.gz: d3f1fad60e55fbb88ef5e8a50535ccd5a05a20a4
4
+ data.tar.gz: e574370f0aa62a710bb5f382a7a7582f5bb01afd
5
5
  SHA512:
6
- metadata.gz: 009a8ae37fa22f051a1e169a2b39f4d52a003f93642c77117cd822f63c5aaddb19f31d40182a5938d0f653516b3f74d1140abb81c31f539064204ad731ccfb6e
7
- data.tar.gz: 9857469420b2454aa6fb58b6dd863f4a328ff4fdc3c553f83dd45a36192febc3da1a1519c972eff503ee06637c9517f4da4611ac474be8bdc5e13a70b08c17b4
6
+ metadata.gz: 73d37a1223e4b25fd3ecd6cab281255f9994afe8410982de4e13942f9168b967b5ec1d4f6ff8268a1bbf69194907f9f38d1e04725efbcea3a5bc8d2a83c5be03
7
+ data.tar.gz: 68ff6488249a052a596ec8cdfa0af5753ac9b2f55c16d3b3812651df5da63d2688c5674c548b5c898d6774697936680dbf2a1ef50e1b287bf99fe4eca433fe9f
data/.gitignore CHANGED
@@ -12,4 +12,6 @@ Gemfile.lock
12
12
  /vendor/bundle
13
13
  tmp/
14
14
  test/screenshots/
15
- test/dummy/log/*.log
15
+ test/dummy_rails/log/*.log
16
+
17
+ .DS_Store
@@ -1,12 +1,15 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.1
3
4
  - 2.0.0
4
- - 1.9.3
5
5
  - jruby
6
- - rbx-2.2.4
6
+ - rbx
7
7
  gemfile:
8
8
  - test/gemfiles/sass_3_2.gemfile
9
+ - test/gemfiles/sass_3_3.gemfile
9
10
  - test/gemfiles/sass_head.gemfile
11
+ before_install:
12
+ - "npm install node-sass mincer ejs"
10
13
  matrix:
11
14
  allow_failures:
12
15
  - gemfile: test/gemfiles/sass_head.gemfile
data/Gemfile CHANGED
@@ -9,3 +9,7 @@ platform :rbx do
9
9
  gem 'racc'
10
10
  end
11
11
 
12
+ platform :jruby do
13
+ gem 'test-unit'
14
+ end
15
+
data/README.md CHANGED
@@ -1,6 +1,4 @@
1
- # Bootstrap for Sass
2
-
3
- [![Build Status](https://secure.travis-ci.org/twbs/bootstrap-sass.png?branch=master)](http://travis-ci.org/twbs/bootstrap-sass)
1
+ # Bootstrap for Sass [![Build Status](http://img.shields.io/travis/twbs/bootstrap-sass.svg)](http://travis-ci.org/twbs/bootstrap-sass)
4
2
 
5
3
  `bootstrap-sass` is a Sass-powered version of [Bootstrap](http://github.com/twbs/bootstrap), ready to drop right into your Sass powered applications.
6
4
 
@@ -15,7 +13,7 @@ Please see the appropriate guide for your environment of choice:
15
13
  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.
16
14
 
17
15
  ```ruby
18
- gem 'sass-rails', '>= 3.2' # sass-rails needs to be higher than 3.2
16
+ gem 'sass-rails', '>= 3.2'
19
17
  gem 'bootstrap-sass', '~> 3.1.1'
20
18
  ```
21
19
 
@@ -24,8 +22,9 @@ gem 'bootstrap-sass', '~> 3.1.1'
24
22
 
25
23
  #### Rails 3.2.x
26
24
 
27
- For Rails 3.2.x, make sure that all the gems are moved out of the `:assets` group, and `config.assets.initialize_on_precompile` is set to `true`.
28
-
25
+ For Rails 3.2.x, make sure bootstrap-sass is moved out of the `:assets` group.
26
+ This is because, by default, assets group gems are not required in `production`.
27
+ However, for pre-compilation to succeed in production, `bootstrap-sass` gem must be required.
29
28
 
30
29
  ### b. Compass without Rails
31
30
 
@@ -51,10 +50,16 @@ If you are creating a new Compass project, you can generate it with bootstrap-sa
51
50
  bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
52
51
  ```
53
52
 
53
+ or, alternatively, if you're not using a Gemfile for your dependencies:
54
+
55
+ ```console
56
+ compass create my-new-project -r bootstrap-sass --using bootstrap
57
+ ```
58
+
54
59
  This will create a new Compass project with the following files in it:
55
60
 
56
- * [_variables.scss](/templates/project/_variables.scss.erb) - all of bootstrap variables (override them here).
57
- * [styles.scss](/templates/project/styles.scss) - main project SCSS file, import `variables` and `bootstrap`.
61
+ * [_variables.scss](/templates/project/_variables.sass.erb) - all of bootstrap variables (override them here).
62
+ * [styles.scss](/templates/project/styles.sass) - main project SCSS file, import `variables` and `bootstrap`.
58
63
 
59
64
  Some bootstrap-sass mixins may conflict with the Compass ones.
60
65
  If this happens, change the import order so that Compass mixins are loaded later.
@@ -67,20 +72,33 @@ Require the gem, and load paths and Sass helpers will be configured automaticall
67
72
  require 'bootstrap-sass'
68
73
  ```
69
74
 
70
- ### d. Bower
75
+ ### d. Node.js / Bower
71
76
 
72
- Using bootstrap-sass as a Bower package is still being tested and requires libsass master. You can install it with:
77
+ 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:
73
78
 
74
79
  ```bash
75
- bower install git://github.com/twbs/bootstrap-sass.git
80
+ bower install bootstrap-sass-official
76
81
  ```
77
82
 
78
- `bootstrap-sass` is taken so make sure you use the Git URL above.
83
+ `bootstrap-sass` is taken so make sure you use the command above.
79
84
 
80
85
  Sass, JS, and all other assets are located at [vendor/assets](/vendor/assets).
81
86
 
82
- bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 10 (default is 5).
87
+ #### Mincer
83
88
 
89
+ If you use [mincer][mincer] with node-sass, import bootstrap into a `.css.ejs.scss` file like so:
90
+
91
+ ```scss
92
+ // Import mincer asset paths helper integration
93
+ @import "bootstrap-mincer";
94
+ @import "bootstrap";
95
+ ```
96
+
97
+ See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for mincer.
98
+
99
+ #### Number precision
100
+
101
+ bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 10 (default is 5).
84
102
 
85
103
  When using ruby Sass compiler with the bower version you can enforce the limit with:
86
104
 
@@ -88,14 +106,16 @@ When using ruby Sass compiler with the bower version you can enforce the limit w
88
106
  ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
89
107
  ```
90
108
 
109
+ Precision option is now available in libsass, but it has not made into node-sass yet.
110
+
91
111
  #### JS and fonts
92
112
 
93
- Assets are discovered automatically on Rails, Sprockets, and Compass, using native asset path helpers.
113
+ Assets are discovered automatically on Rails, Sprockets, Compass, and Node + Mincer, using native asset path helpers.
94
114
 
95
115
  Otherwise the fonts are referenced as:
96
116
 
97
117
  ```sass
98
- "#{$icon-font-path}/#{$icon-font-name}.eot"
118
+ "#{$icon-font-path}#{$icon-font-name}.eot"
99
119
  ```
100
120
 
101
121
  `$icon-font-path` defaults to `bootstrap/`.
@@ -152,7 +172,7 @@ In `application.sass`, replace `@import 'bootstrap'` with:
152
172
 
153
173
  ### Javascript
154
174
 
155
- We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately),
175
+ We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately),
156
176
  put this in your Javascript manifest (usually in `application.js`) to load the files in the [correct order](/vendor/assets/javascripts/bootstrap.js):
157
177
 
158
178
  ```js
@@ -183,12 +203,12 @@ Keeping bootstrap-sass in sync with upstream changes from Bootstrap used to be a
183
203
  Upstream changes to the Bootstrap project can now be pulled in using the `convert` rake task.
184
204
 
185
205
  Here's an example run that would pull down the master branch from the main [twbs/bootstrap](https://github.com/twbs/bootstrap) repo:
186
-
206
+
187
207
  rake convert
188
-
189
- This will convert the latest LESS to SASS and update to the latest JS.
208
+
209
+ This will convert the latest LESS to Sass and update to the latest JS.
190
210
  To convert a specific branch or version, pass the branch name or the commit hash as the first task argument:
191
-
211
+
192
212
  rake convert[e8a1df5f060bf7e6631554648e0abde150aedbe4]
193
213
 
194
214
  The latest converter script is located [here][converter] and does the following:
@@ -226,3 +246,4 @@ Michael Hartl's [Rails Tutorial](http://railstutorial.org/), [gitlabhq](http://g
226
246
  [antirequire]: https://github.com/twbs/bootstrap-sass/issues/79#issuecomment-4428595
227
247
  [jsdocs]: http://getbootstrap.com/javascript/#transitions
228
248
  [sass-precision]: http://sass-lang.com/documentation/Sass/Script/Number.html#precision-class_method
249
+ [mincer]: https://github.com/nodeca/mincer
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ load './tasks/bower.rake'
2
+
1
3
  require 'rake/testtask'
2
4
  Rake::TestTask.new do |t|
3
5
  t.libs << "test"
@@ -37,13 +39,14 @@ task :compile, :css_path do |t, args|
37
39
  require 'term/ansicolor'
38
40
 
39
41
  path = 'vendor/assets/stylesheets'
42
+ css_path = args.with_defaults(css_path: 'tmp')[:css_path]
40
43
  puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
44
+ Dir.mkdir(css_path) unless File.directory?(css_path)
41
45
  %w(bootstrap bootstrap/_theme).each do |file|
42
- save_path = "#{args.with_defaults(css_path: 'tmp')[:css_path]}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
46
+ save_path = "#{css_path}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
43
47
  puts Term::ANSIColor.cyan(" #{save_path}") + '...'
44
48
  engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
45
49
  css = engine.render
46
- File.mkdir('tmp') unless File.directory?('tmp')
47
50
  File.open(save_path, 'w') { |f| f.write css }
48
51
  end
49
52
  end
@@ -11,17 +11,20 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/twbs/bootstrap-sass"
12
12
  s.license = 'MIT'
13
13
 
14
- s.add_development_dependency 'compass'
15
- s.add_development_dependency 'term-ansicolor'
16
- s.add_development_dependency 'sass-rails', '>= 3.2'
17
14
  s.add_runtime_dependency 'sass', '~> 3.2'
18
15
 
19
- s.add_development_dependency 'capybara'
20
- s.add_development_dependency 'poltergeist'
21
- s.add_development_dependency 'tzinfo'
22
- s.add_development_dependency 'jquery-rails'
16
+ # Dummy Rails app dependencies
17
+ s.add_development_dependency 'sprockets-rails', '>= 2.0.1'
18
+ s.add_development_dependency 'jquery-rails', '>= 3.1.0'
23
19
  s.add_development_dependency 'slim-rails'
24
20
  s.add_development_dependency 'uglifier'
21
+ # Compass dummy app
22
+ s.add_development_dependency 'compass'
23
+ # Integration testing
24
+ s.add_development_dependency 'capybara'
25
+ s.add_development_dependency 'poltergeist'
26
+ # Converter
27
+ s.add_development_dependency 'term-ansicolor'
25
28
 
26
29
  s.files = `git ls-files`.split("\n")
27
30
  s.test_files = `git ls-files -- test/*`.split("\n")
data/bower.json CHANGED
@@ -9,7 +9,96 @@
9
9
  "Gleb Mazovetskiy"
10
10
  ],
11
11
  "description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
12
- "main": ["vendor/assets/stylesheets/bootstrap.scss", "vendor/assets/javascripts/bootstrap.js"],
12
+ "main": [
13
+ "vendor/assets/stylesheets/_bootstrap-mincer.scss",
14
+ "vendor/assets/stylesheets/bootstrap/_alerts.scss",
15
+ "vendor/assets/stylesheets/bootstrap/_badges.scss",
16
+ "vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss",
17
+ "vendor/assets/stylesheets/bootstrap/_button-groups.scss",
18
+ "vendor/assets/stylesheets/bootstrap/_buttons.scss",
19
+ "vendor/assets/stylesheets/bootstrap/_carousel.scss",
20
+ "vendor/assets/stylesheets/bootstrap/_close.scss",
21
+ "vendor/assets/stylesheets/bootstrap/_code.scss",
22
+ "vendor/assets/stylesheets/bootstrap/_component-animations.scss",
23
+ "vendor/assets/stylesheets/bootstrap/_dropdowns.scss",
24
+ "vendor/assets/stylesheets/bootstrap/_forms.scss",
25
+ "vendor/assets/stylesheets/bootstrap/_glyphicons.scss",
26
+ "vendor/assets/stylesheets/bootstrap/_grid.scss",
27
+ "vendor/assets/stylesheets/bootstrap/_input-groups.scss",
28
+ "vendor/assets/stylesheets/bootstrap/_jumbotron.scss",
29
+ "vendor/assets/stylesheets/bootstrap/_labels.scss",
30
+ "vendor/assets/stylesheets/bootstrap/_list-group.scss",
31
+ "vendor/assets/stylesheets/bootstrap/_media.scss",
32
+ "vendor/assets/stylesheets/bootstrap/_mixins.scss",
33
+ "vendor/assets/stylesheets/bootstrap/_modals.scss",
34
+ "vendor/assets/stylesheets/bootstrap/_navbar.scss",
35
+ "vendor/assets/stylesheets/bootstrap/_navs.scss",
36
+ "vendor/assets/stylesheets/bootstrap/_normalize.scss",
37
+ "vendor/assets/stylesheets/bootstrap/_pager.scss",
38
+ "vendor/assets/stylesheets/bootstrap/_pagination.scss",
39
+ "vendor/assets/stylesheets/bootstrap/_panels.scss",
40
+ "vendor/assets/stylesheets/bootstrap/_popovers.scss",
41
+ "vendor/assets/stylesheets/bootstrap/_print.scss",
42
+ "vendor/assets/stylesheets/bootstrap/_progress-bars.scss",
43
+ "vendor/assets/stylesheets/bootstrap/_responsive-embed.scss",
44
+ "vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss",
45
+ "vendor/assets/stylesheets/bootstrap/_scaffolding.scss",
46
+ "vendor/assets/stylesheets/bootstrap/_tables.scss",
47
+ "vendor/assets/stylesheets/bootstrap/_theme.scss",
48
+ "vendor/assets/stylesheets/bootstrap/_thumbnails.scss",
49
+ "vendor/assets/stylesheets/bootstrap/_tooltip.scss",
50
+ "vendor/assets/stylesheets/bootstrap/_type.scss",
51
+ "vendor/assets/stylesheets/bootstrap/_utilities.scss",
52
+ "vendor/assets/stylesheets/bootstrap/_variables.scss",
53
+ "vendor/assets/stylesheets/bootstrap/_wells.scss",
54
+ "vendor/assets/stylesheets/bootstrap/bootstrap.scss",
55
+ "vendor/assets/stylesheets/bootstrap/mixins/_alerts.scss",
56
+ "vendor/assets/stylesheets/bootstrap/mixins/_background-variant.scss",
57
+ "vendor/assets/stylesheets/bootstrap/mixins/_border-radius.scss",
58
+ "vendor/assets/stylesheets/bootstrap/mixins/_buttons.scss",
59
+ "vendor/assets/stylesheets/bootstrap/mixins/_center-block.scss",
60
+ "vendor/assets/stylesheets/bootstrap/mixins/_clearfix.scss",
61
+ "vendor/assets/stylesheets/bootstrap/mixins/_forms.scss",
62
+ "vendor/assets/stylesheets/bootstrap/mixins/_gradients.scss",
63
+ "vendor/assets/stylesheets/bootstrap/mixins/_grid-framework.scss",
64
+ "vendor/assets/stylesheets/bootstrap/mixins/_grid.scss",
65
+ "vendor/assets/stylesheets/bootstrap/mixins/_hide-text.scss",
66
+ "vendor/assets/stylesheets/bootstrap/mixins/_image.scss",
67
+ "vendor/assets/stylesheets/bootstrap/mixins/_labels.scss",
68
+ "vendor/assets/stylesheets/bootstrap/mixins/_list-group.scss",
69
+ "vendor/assets/stylesheets/bootstrap/mixins/_nav-divider.scss",
70
+ "vendor/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss",
71
+ "vendor/assets/stylesheets/bootstrap/mixins/_opacity.scss",
72
+ "vendor/assets/stylesheets/bootstrap/mixins/_pagination.scss",
73
+ "vendor/assets/stylesheets/bootstrap/mixins/_panels.scss",
74
+ "vendor/assets/stylesheets/bootstrap/mixins/_progress-bar.scss",
75
+ "vendor/assets/stylesheets/bootstrap/mixins/_reset-filter.scss",
76
+ "vendor/assets/stylesheets/bootstrap/mixins/_resize.scss",
77
+ "vendor/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss",
78
+ "vendor/assets/stylesheets/bootstrap/mixins/_size.scss",
79
+ "vendor/assets/stylesheets/bootstrap/mixins/_tab-focus.scss",
80
+ "vendor/assets/stylesheets/bootstrap/mixins/_table-row.scss",
81
+ "vendor/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss",
82
+ "vendor/assets/stylesheets/bootstrap/mixins/_text-overflow.scss",
83
+ "vendor/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss",
84
+ "vendor/assets/stylesheets/bootstrap.scss",
85
+ "vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot",
86
+ "vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
87
+ "vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
88
+ "vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
89
+ "vendor/assets/javascripts/bootstrap/affix.js",
90
+ "vendor/assets/javascripts/bootstrap/alert.js",
91
+ "vendor/assets/javascripts/bootstrap/button.js",
92
+ "vendor/assets/javascripts/bootstrap/carousel.js",
93
+ "vendor/assets/javascripts/bootstrap/collapse.js",
94
+ "vendor/assets/javascripts/bootstrap/dropdown.js",
95
+ "vendor/assets/javascripts/bootstrap/tab.js",
96
+ "vendor/assets/javascripts/bootstrap/transition.js",
97
+ "vendor/assets/javascripts/bootstrap/scrollspy.js",
98
+ "vendor/assets/javascripts/bootstrap/modal.js",
99
+ "vendor/assets/javascripts/bootstrap/tooltip.js",
100
+ "vendor/assets/javascripts/bootstrap/popover.js"
101
+ ],
13
102
  "keywords": [
14
103
  "twbs",
15
104
  "bootstrap",
@@ -17,6 +106,13 @@
17
106
  ],
18
107
  "license": "MIT",
19
108
  "ignore": [
20
- "**/.*", "lib", "tasks", "templates", "test", "*.gemspec", "Rakefile", "Gemfile"
109
+ "**/.*",
110
+ "lib",
111
+ "tasks",
112
+ "templates",
113
+ "test",
114
+ "*.gemspec",
115
+ "Rakefile",
116
+ "Gemfile"
21
117
  ]
22
118
  }
@@ -6,7 +6,6 @@ module Bootstrap
6
6
  register_compass_extension if compass?
7
7
 
8
8
  if rails?
9
- require 'sass-rails'
10
9
  register_rails_engine
11
10
  end
12
11
 
@@ -1,4 +1,4 @@
1
1
  module Bootstrap
2
- VERSION = '3.1.1.0'
3
- BOOTSTRAP_SHA = '385fb6898128bbfdc3def581bb92e01818fa0525'
2
+ VERSION = '3.1.1.1'
3
+ BOOTSTRAP_SHA = '573ad10a9dba52e4a6f059e63b667f4034ad2b39'
4
4
  end
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "bootstrap-sass",
3
+ "version": "3.1.1",
4
+ "description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
5
+ "main": "index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git://github.com/twbs/bootstrap-sass"
9
+ },
10
+ "keywords": [
11
+ "bootstrap",
12
+ "sass",
13
+ "css"
14
+ ],
15
+ "contributors": [
16
+ "Thomas McDonald",
17
+ "Tristan Harward",
18
+ "Peter Gumeson",
19
+ "Gleb Mazovetskiy"
20
+ ],
21
+ "license": "MIT",
22
+ "bugs": {
23
+ "url": "https://github.com/twbs/bootstrap-sass/issues"
24
+ }
25
+ }
@@ -0,0 +1,33 @@
1
+ require 'find'
2
+ require 'bootstrap-sass'
3
+ require 'json'
4
+ require 'pathname'
5
+
6
+ namespace :bower do
7
+
8
+ find_files = ->(path) {
9
+ Find.find(Pathname.new(path).relative_path_from(Pathname.new Dir.pwd).to_s).map do |path|
10
+ path if File.file?(path)
11
+ end.compact
12
+ }
13
+
14
+ desc 'update main and version in bower.json'
15
+ task :spec do
16
+ Dir.chdir Bootstrap.gem_path do
17
+ spec = JSON.parse(File.read 'bower.json')
18
+ js_paths = File.read(File.join Bootstrap.javascripts_path, 'bootstrap.js').lines.map do |line|
19
+ line.strip if line.sub!(%r(//\s*=\s*require\s*(.*)\s*), 'vendor/assets/javascripts/\1.js')
20
+ end.compact
21
+
22
+ spec['main'] = find_files.(Bootstrap.stylesheets_path) +
23
+ find_files.(Bootstrap.fonts_path) +
24
+ js_paths
25
+
26
+ spec['version'] = Bootstrap::VERSION[0..-3]
27
+
28
+ File.open('bower.json', 'w') do |f|
29
+ f.puts JSON.pretty_generate(spec)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -59,13 +59,15 @@ class Converter
59
59
 
60
60
  @save_to.each { |_, v| FileUtils.mkdir_p(v) }
61
61
 
62
+ process_font_assets
62
63
  process_stylesheet_assets
63
64
  process_javascript_assets
64
- process_font_assets
65
65
  store_version
66
66
  end
67
67
 
68
68
  def save_file(path, content, mode='w')
69
+ dir = File.dirname(path)
70
+ FileUtils.mkdir_p(dir) unless File.directory?(dir)
69
71
  File.open(path, mode) { |file| file.write(content) }
70
72
  end
71
73
 
@@ -26,12 +26,12 @@ class Converter
26
26
  SCSS_MIXIN_DEF_ARGS_RE = /[\w\-,\s$:#%()]*/
27
27
  LESS_MIXIN_DEF_ARGS_RE = /[\w\-,;.\s@:#%()]*/
28
28
 
29
- # These mixins are nested (not supported by SCSS), and need to flattened:
29
+ # These mixins will get vararg definitions in SCSS (not supported by LESS):
30
30
  NESTED_MIXINS = {'#gradient' => 'gradient'}
31
31
 
32
32
  # These mixins will get vararg definitions in SCSS (not supported by LESS):
33
33
  VARARG_MIXINS = %w(
34
- transition transition-duration transition-property transition-transform box-shadow
34
+ scale transition transition-duration transition-property transition-transform box-shadow
35
35
  )
36
36
 
37
37
  # Convert a snippet of bootstrap LESS to Scss
@@ -45,7 +45,7 @@ class Converter
45
45
  def load_shared
46
46
  @shared_mixins ||= begin
47
47
  log_status ' Reading shared mixins from mixins.less'
48
- read_mixins read_files('less', ['mixins.less'])['mixins.less'], nested: NESTED_MIXINS
48
+ read_mixins read_files('less', bootstrap_less_files.grep(/mixins\//)).values.join("\n"), nested: NESTED_MIXINS
49
49
  end
50
50
  end
51
51
 
@@ -59,27 +59,31 @@ class Converter
59
59
  log_processing name
60
60
  # apply common conversions
61
61
  file = convert_less(file)
62
+ if name.start_with?('mixins/')
63
+ file = varargify_mixin_definitions(file, *VARARG_MIXINS)
64
+ %w(responsive-(in)?visibility input-size text-emphasis-variant bg-variant).each do |mixin|
65
+ file = parameterize_mixin_parent_selector file, mixin if file =~ /#{mixin}/
66
+ end
67
+ NESTED_MIXINS.each do |sel, name|
68
+ file = flatten_mixins(file, sel, name) if /#{Regexp.escape(sel)}/ =~ file
69
+ end
70
+ file = replace_all file, /(?<=[.-])\$state/, '#{$state}' if file =~ /[.-]\$state/
71
+ end
62
72
  case name
63
- when 'mixins.less'
64
- NESTED_MIXINS.each do |selector, prefix|
65
- file = flatten_mixins(file, selector, prefix)
66
- end
67
- file = varargify_mixin_definitions(file, *VARARG_MIXINS)
68
- file = deinterpolate_vararg_mixins(file)
69
- %w(responsive-(in)?visibility input-size text-emphasis-variant bg-variant).each do |mixin|
70
- file = parameterize_mixin_parent_selector file, mixin
71
- end
72
- file = replace_ms_filters(file)
73
- file = replace_all file, /(?<=[.-])\$state/, '#{$state}'
73
+ when 'mixins/buttons.less'
74
+ file = replace_all file, /(\.dropdown-toggle)&/, '&\1'
75
+ when 'mixins/list-group.less'
74
76
  file = replace_rules(file, ' .list-group-item-') { |rule| extract_nested_rule rule, 'a&' }
75
- file = replace_all file, /,\s*\.open \.dropdown-toggle& \{(.*?)\}/m,
76
- " {\\1}\n .open & { &.dropdown-toggle {\\1} }"
77
-
78
- # make +scale(one_argument) compatible with Sass list handling
79
- # see https://github.com/twbs/bootstrap-sass/issues/518
80
- file = replace_all file, '$ratio, $ratio-y', '$scale-args'
81
-
77
+ when 'mixins/gradients.less'
78
+ file = replace_ms_filters(file)
79
+ file = deinterpolate_vararg_mixins(file)
80
+ when 'mixins/vendor-prefixes.less'
81
+ # remove second scale mixins as this is handled via vararg in the first one
82
+ file = replace_rules(file, '.scale(@ratioX; @ratioY)') {}
83
+ when 'mixins/grid-framework.less'
82
84
  file = convert_grid_mixins file
85
+ when 'component-animations.less'
86
+ file = extract_nested_rule file, "#{SELECTOR_RE}&\\.in"
83
87
  when 'responsive-utilities.less'
84
88
  file = apply_mixin_parent_selector file, '\.(?:visible|hidden)'
85
89
  when 'variables.less'
@@ -104,9 +108,10 @@ class Converter
104
108
  file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
105
109
  when 'tables.less'
106
110
  file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
107
- when 'thumbnails.less'
111
+ when 'thumbnails.less', 'labels.less', 'badges.less'
108
112
  file = extract_nested_rule file, 'a&'
109
113
  when 'glyphicons.less'
114
+ file = bootstrap_font_files.map { |p| %Q(//= depend_on_asset "bootstrap/#{File.basename(p)}") } * "\n" + "\n" + file
110
115
  file = replace_all file, /\#\{(url\(.*?\))}/, '\1'
111
116
  file = replace_rules(file, '@font-face') { |rule|
112
117
  rule = replace_all rule, /(\$icon-font(?:-\w+)+)/, '#{\1}'
@@ -119,7 +124,10 @@ class Converter
119
124
  end
120
125
 
121
126
  name = name.sub(/\.less$/, '.scss')
122
- path = "#{save_to}/#{'_' unless name == 'bootstrap.scss'}#{name}"
127
+ path = File.join save_to, name
128
+ unless name == 'bootstrap.scss'
129
+ path = File.join File.dirname(path), '_' + File.basename(path)
130
+ end
123
131
  save_file(path, file)
124
132
  log_processed File.basename(path)
125
133
  end
@@ -130,7 +138,9 @@ class Converter
130
138
  end
131
139
 
132
140
  def bootstrap_less_files
133
- @bootstrap_less_files ||= get_paths_by_type('less', /\.less$/)
141
+ @bootstrap_less_files ||= get_paths_by_type('less', /\.less$/) +
142
+ get_paths_by_type('mixins', /\.less$/,
143
+ get_tree(get_tree_sha('mixins', get_tree(get_tree_sha('less'))))).map { |p| "mixins/#{p}" }
134
144
  end
135
145
 
136
146
  # apply general less to scss conversion
@@ -138,15 +148,16 @@ class Converter
138
148
  # get local mixin names before converting the definitions
139
149
  mixins = @shared_mixins + read_mixins(file)
140
150
  file = replace_vars(file)
141
- file = replace_file_imports(file)
142
151
  file = replace_mixin_definitions(file)
143
152
  file = replace_mixins(file, mixins)
144
153
  file = replace_spin(file)
154
+ file = replace_fadein(file)
145
155
  file = replace_image_urls(file)
146
156
  file = replace_escaping(file)
147
157
  file = convert_less_ampersand(file)
148
158
  file = deinterpolate_vararg_mixins(file)
149
159
  file = replace_calculation_semantics(file)
160
+ file = replace_file_imports(file)
150
161
  file
151
162
  end
152
163
 
@@ -183,7 +194,7 @@ SASS
183
194
  mixin_all_grid_columns css, selector: '.col-#{$class}-#{$i}', to: '$grid-columns'
184
195
  end
185
196
  file = replace_rules file, /@mixin calc-grid-column/ do |css|
186
- css = indent css.gsub(/.*when (.*?) {/, '@if \1 {').gsub(/(?<=\$type) = (\w+)/, ' == \1').gsub(/(?<=-)(\$[a-z]+)/, '#{\1}')
197
+ css = indent css.gsub(/.*when (.*?) {/, '@if \1 {').gsub(/(\$[\w-]+)\s+=\s+(\w+)/, '\1 == \2').gsub(/(?<=-)(\$[a-z]+)/, '#{\1}')
187
198
  if css =~ /== width/
188
199
  css = "@mixin calc-grid-column($index, $class, $type) {\n#{css}"
189
200
  elsif css =~ /== offset/
@@ -279,7 +290,7 @@ SASS
279
290
 
280
291
  # @import "file.less" to "#{target_path}file;"
281
292
  def replace_file_imports(less, target_path = '')
282
- less.gsub %r([@\$]import ["|']([\w-]+).less["|'];),
293
+ less.gsub %r([@\$]import ["|']([\w\-/]+).less["|'];),
283
294
  %Q(@import "#{target_path}\\1";)
284
295
  end
285
296
 
@@ -320,15 +331,15 @@ SASS
320
331
  matches = []
321
332
  # first find the rules, and remove them
322
333
  file = replace_rules(file, "\s*#{selector}", comments: true) { |rule, pos, css|
323
- matches << [rule, pos]
324
- new_selector ||= "#{get_selector(rule).gsub(/&/, selector_for_pos(css, pos.begin))}"
325
- indent "// [converter] extracted #{get_selector(rule)} to #{new_selector}".tr("\n", ' ').squeeze(' '), indent_width(rule)
334
+ new_sel = new_selector || "#{get_selector(rule).gsub(/&/, selector_for_pos(css, pos.begin))}"
335
+ matches << [rule, pos, new_sel]
336
+ indent "// [converter] extracted #{get_selector(rule)} to #{new_sel}".tr("\n", ' ').squeeze(' '), indent_width(rule)
326
337
  }
327
338
  raise "extract_nested_rule: no such selector: #{selector}" if matches.empty?
328
- log_transform selector, new_selector
329
339
  # replace rule selector with new_selector
330
340
  matches.each do |m|
331
- m[0].sub! /(#{COMMENT_RE}*)^(\s*).*?(\s*){/m, "\\1\\2#{new_selector}\\3{"
341
+ m[0].sub! /(#{COMMENT_RE}*)^(\s*).*?(\s*){/m, "\\1\\2#{m[2]}\\3{"
342
+ log_transform selector, m[2]
332
343
  end
333
344
  replace_substrings_at file,
334
345
  matches.map { |_, pos| close_brace_pos(file, pos.begin, 1) + 1 },
@@ -440,6 +451,10 @@ SASS
440
451
  less.gsub(/(?![\-$@.])spin(?!-)/, 'adjust-hue')
441
452
  end
442
453
 
454
+ def replace_fadein(less)
455
+ less.gsub(/(?![\-$@.])fadein\((.*?),\s*(.*?)%\)/) { "rgba(#{$1}, #{$2.to_i / 100.0})" }
456
+ end
457
+
443
458
  def replace_image_urls(less)
444
459
  less.gsub(/background-image: url\("?(.*?)"?\);/) { |s| replace_asset_url s, :image }
445
460
  end
@@ -488,11 +503,14 @@ SASS
488
503
  # to:
489
504
  # @mixin transition($transition...) {
490
505
  def varargify_mixin_definitions(scss, *mixins)
491
- log_transform *mixins
492
506
  scss = scss.dup
507
+ replaced = []
493
508
  mixins.each do |mixin|
494
- scss.gsub! /(@mixin\s*#{Regexp.quote(mixin)})\((#{SCSS_MIXIN_DEF_ARGS_RE})\)/, '\1(\2...)'
509
+ if scss.gsub! /(@mixin\s*#{Regexp.quote(mixin)})\((#{SCSS_MIXIN_DEF_ARGS_RE})\)/, '\1(\2...)'
510
+ replaced << mixin
511
+ end
495
512
  end
513
+ log_transform *replaced unless replaced.empty?
496
514
  scss
497
515
  end
498
516
 
@@ -511,7 +529,8 @@ SASS
511
529
 
512
530
  # get full selector for rule_block
513
531
  def get_selector(rule_block)
514
- /^\s*(#{SELECTOR_RE}?)\s*\{/.match(rule_block) && $1 && $1.strip
532
+ sel = /^\s*(#{SELECTOR_RE}?)\s*\{/.match(rule_block) && $1 && $1.strip
533
+ sel.sub /\s*\{\n\s.*/m, ''
515
534
  end
516
535
 
517
536
  # replace CSS rule blocks matching rule_prefix with yield(rule_block, rule_pos)