twitter-bootstrap-rails 5.3.1 → 5.5.0

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 (235) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +124 -0
  3. data/README.md +221 -4
  4. data/app/assets/javascripts/twitter/bootstrap/bootstrap.min.js +3 -3
  5. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css +3 -3
  6. data/app/helpers/badge_label_helper.rb +5 -6
  7. data/app/helpers/bootstrap_flash_helper.rb +10 -5
  8. data/app/helpers/flash_block_helper.rb +6 -4
  9. data/app/helpers/form_errors_helper.rb +3 -2
  10. data/app/helpers/modal_helper.rb +13 -13
  11. data/app/helpers/navbar_helper.rb +54 -47
  12. data/app/helpers/twitter_breadcrumbs_helper.rb +2 -2
  13. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +11 -11
  14. data/lib/generators/bootstrap/agent/agent_generator.rb +81 -0
  15. data/lib/generators/bootstrap/agent/templates/guide.md.erb +61 -0
  16. data/lib/generators/bootstrap/badge/badge_generator.rb +13 -0
  17. data/lib/generators/bootstrap/breadcrumb/breadcrumb_generator.rb +13 -0
  18. data/lib/generators/bootstrap/button/button_generator.rb +13 -0
  19. data/lib/generators/bootstrap/cdn/cdn_generator.rb +39 -0
  20. data/lib/generators/bootstrap/cdn_tags.rb +43 -0
  21. data/lib/generators/bootstrap/doctor/doctor_generator.rb +39 -0
  22. data/lib/generators/bootstrap/dropdown/dropdown_generator.rb +13 -0
  23. data/lib/generators/bootstrap/features/features_generator.rb +13 -0
  24. data/lib/generators/bootstrap/footer/footer_generator.rb +13 -0
  25. data/lib/generators/bootstrap/header/header_generator.rb +13 -0
  26. data/lib/generators/bootstrap/hero/hero_generator.rb +13 -0
  27. data/lib/generators/bootstrap/install/install_generator.rb +120 -61
  28. data/lib/generators/bootstrap/install/templates/application.js +1 -1
  29. data/lib/generators/bootstrap/install/templates/bootstrap.js +10 -3
  30. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +2 -2
  31. data/lib/generators/bootstrap/jumbotron/jumbotron_generator.rb +13 -0
  32. data/lib/generators/bootstrap/layout/layout_generator.rb +65 -1
  33. data/lib/generators/bootstrap/layout/templates/layout.html.erb +14 -9
  34. data/lib/generators/bootstrap/layout/templates/layout.html.haml +28 -43
  35. data/lib/generators/bootstrap/layout/templates/layout.html.slim +25 -40
  36. data/lib/generators/bootstrap/list_group/list_group_generator.rb +13 -0
  37. data/lib/generators/bootstrap/modal/modal_generator.rb +13 -0
  38. data/lib/generators/bootstrap/partial/templates/_login.html.erb +11 -15
  39. data/lib/generators/bootstrap/sidebar/sidebar_generator.rb +13 -0
  40. data/lib/generators/bootstrap/snippets/snippet_base.rb +145 -0
  41. data/lib/generators/bootstrap/snippets/snippet_catalog.rb +134 -0
  42. data/lib/generators/bootstrap/snippets/templates/badges/pills.html.erb +10 -0
  43. data/lib/generators/bootstrap/snippets/templates/badges/subtle.html.erb +10 -0
  44. data/lib/generators/bootstrap/snippets/templates/badges/subtle_bordered.html.erb +20 -0
  45. data/lib/generators/bootstrap/snippets/templates/badges/with_avatar.html.erb +34 -0
  46. data/lib/generators/bootstrap/snippets/templates/badges/with_avatar_divider.html.erb +66 -0
  47. data/lib/generators/bootstrap/snippets/templates/badges/with_icons.html.erb +26 -0
  48. data/lib/generators/bootstrap/snippets/templates/breadcrumbs/basic.html.erb +9 -0
  49. data/lib/generators/bootstrap/snippets/templates/breadcrumbs/chevron.html.erb +18 -0
  50. data/lib/generators/bootstrap/snippets/templates/breadcrumbs/custom.html.erb +18 -0
  51. data/lib/generators/bootstrap/snippets/templates/breadcrumbs/with_icons.html.erb +18 -0
  52. data/lib/generators/bootstrap/snippets/templates/buttons/circle.html.erb +20 -0
  53. data/lib/generators/bootstrap/snippets/templates/buttons/grid.html.erb +6 -0
  54. data/lib/generators/bootstrap/snippets/templates/buttons/loading.html.erb +10 -0
  55. data/lib/generators/bootstrap/snippets/templates/buttons/pills.html.erb +11 -0
  56. data/lib/generators/bootstrap/snippets/templates/buttons/with_icons.html.erb +14 -0
  57. data/lib/generators/bootstrap/snippets/templates/dropdowns/calendar.html.erb +156 -0
  58. data/lib/generators/bootstrap/snippets/templates/dropdowns/mega_menu.html.erb +140 -0
  59. data/lib/generators/bootstrap/snippets/templates/dropdowns/simple.html.erb +20 -0
  60. data/lib/generators/bootstrap/snippets/templates/dropdowns/with_icons.html.erb +88 -0
  61. data/lib/generators/bootstrap/snippets/templates/dropdowns/with_search.html.erb +64 -0
  62. data/lib/generators/bootstrap/snippets/templates/features/columns_with_icons.html.erb +46 -0
  63. data/lib/generators/bootstrap/snippets/templates/features/custom_cards.html.erb +79 -0
  64. data/lib/generators/bootstrap/snippets/templates/features/hanging_icons.html.erb +41 -0
  65. data/lib/generators/bootstrap/snippets/templates/features/icon_grid.html.erb +77 -0
  66. data/lib/generators/bootstrap/snippets/templates/features/with_title.html.erb +50 -0
  67. data/lib/generators/bootstrap/snippets/templates/footers/columns.html.erb +43 -0
  68. data/lib/generators/bootstrap/snippets/templates/footers/simple.html.erb +15 -0
  69. data/lib/generators/bootstrap/snippets/templates/footers/with_brand.html.erb +22 -0
  70. data/lib/generators/bootstrap/snippets/templates/footers/with_nav.html.erb +12 -0
  71. data/lib/generators/bootstrap/snippets/templates/footers/with_newsletter.html.erb +62 -0
  72. data/lib/generators/bootstrap/snippets/templates/headers/centered.html.erb +15 -0
  73. data/lib/generators/bootstrap/snippets/templates/headers/dark_double.html.erb +66 -0
  74. data/lib/generators/bootstrap/snippets/templates/headers/dark_search.html.erb +25 -0
  75. data/lib/generators/bootstrap/snippets/templates/headers/double.html.erb +28 -0
  76. data/lib/generators/bootstrap/snippets/templates/headers/grid_dropdown.html.erb +47 -0
  77. data/lib/generators/bootstrap/snippets/templates/headers/light_search.html.erb +34 -0
  78. data/lib/generators/bootstrap/snippets/templates/headers/nav_pills.html.erb +11 -0
  79. data/lib/generators/bootstrap/snippets/templates/headers/with_auth_buttons.html.erb +22 -0
  80. data/lib/generators/bootstrap/snippets/templates/heroes/centered.html.erb +13 -0
  81. data/lib/generators/bootstrap/snippets/templates/heroes/centered_screenshot.html.erb +17 -0
  82. data/lib/generators/bootstrap/snippets/templates/heroes/cropped_image.html.erb +17 -0
  83. data/lib/generators/bootstrap/snippets/templates/heroes/dark.html.erb +14 -0
  84. data/lib/generators/bootstrap/snippets/templates/heroes/signup_form.html.erb +26 -0
  85. data/lib/generators/bootstrap/snippets/templates/heroes/with_image.html.erb +17 -0
  86. data/lib/generators/bootstrap/snippets/templates/icons/_bootstrap_icons.html.erb +134 -0
  87. data/lib/generators/bootstrap/snippets/templates/jumbotrons/basic.html.erb +10 -0
  88. data/lib/generators/bootstrap/snippets/templates/jumbotrons/full_width.html.erb +12 -0
  89. data/lib/generators/bootstrap/snippets/templates/jumbotrons/placeholder.html.erb +13 -0
  90. data/lib/generators/bootstrap/snippets/templates/jumbotrons/with_icon.html.erb +22 -0
  91. data/lib/generators/bootstrap/snippets/templates/list-groups/checkable.html.erb +24 -0
  92. data/lib/generators/bootstrap/snippets/templates/list-groups/checkboxes.html.erb +45 -0
  93. data/lib/generators/bootstrap/snippets/templates/list-groups/checkboxes_expanded.html.erb +52 -0
  94. data/lib/generators/bootstrap/snippets/templates/list-groups/radios.html.erb +32 -0
  95. data/lib/generators/bootstrap/snippets/templates/list-groups/with_avatars.html.erb +36 -0
  96. data/lib/generators/bootstrap/snippets/templates/modals/confirm.html.erb +18 -0
  97. data/lib/generators/bootstrap/snippets/templates/modals/sheet.html.erb +19 -0
  98. data/lib/generators/bootstrap/snippets/templates/modals/signup.html.erb +44 -0
  99. data/lib/generators/bootstrap/snippets/templates/modals/whats_new.html.erb +41 -0
  100. data/lib/generators/bootstrap/snippets/templates/sidebars/collapsible.html.erb +90 -0
  101. data/lib/generators/bootstrap/snippets/templates/sidebars/dark.html.erb +67 -0
  102. data/lib/generators/bootstrap/snippets/templates/sidebars/icon_only.html.erb +59 -0
  103. data/lib/generators/bootstrap/snippets/templates/sidebars/light.html.erb +67 -0
  104. data/lib/generators/bootstrap/snippets/templates/sidebars/list_group.html.erb +94 -0
  105. data/lib/generators/bootstrap/starter/starter_generator.rb +37 -0
  106. data/lib/generators/bootstrap/starter/templates/starter.html.erb +13 -0
  107. data/lib/generators/bootstrap/themed/templates/_form.html.haml +7 -9
  108. data/lib/generators/bootstrap/themed/templates/_form.html.slim +8 -10
  109. data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -1
  110. data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
  111. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  112. data/lib/generators/bootstrap/themed/templates/index.html.haml +4 -4
  113. data/lib/generators/bootstrap/themed/templates/index.html.slim +4 -4
  114. data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -1
  115. data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
  116. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  117. data/lib/generators/bootstrap/themed/templates/show.html.erb +1 -1
  118. data/lib/generators/bootstrap/themed/templates/show.html.haml +3 -3
  119. data/lib/generators/bootstrap/themed/templates/show.html.slim +3 -3
  120. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +1 -1
  121. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +2 -2
  122. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +2 -2
  123. data/lib/twitter/bootstrap/rails/bootstrap.rb +1 -0
  124. data/lib/twitter/bootstrap/rails/config.rb +54 -0
  125. data/lib/twitter/bootstrap/rails/doctor.rb +207 -0
  126. data/lib/twitter/bootstrap/rails/engine.rb +0 -8
  127. data/lib/twitter/bootstrap/rails/legacy_markup.rb +119 -0
  128. data/lib/twitter/bootstrap/rails/version.rb +28 -1
  129. data/lib/twitter-bootstrap-rails.rb +0 -1
  130. data/spec/lib/breadcrumbs_spec.rb +8 -2
  131. data/spec/lib/generators/agent_generator_spec.rb +111 -0
  132. data/spec/lib/generators/cdn_generator_spec.rb +42 -0
  133. data/spec/lib/generators/doctor_generator_spec.rb +216 -0
  134. data/spec/lib/generators/install_generator_spec.rb +148 -0
  135. data/spec/lib/generators/layout_generator_spec.rb +124 -0
  136. data/spec/lib/generators/no_hardcoded_versions_spec.rb +45 -0
  137. data/spec/lib/generators/snippet_generators_spec.rb +224 -0
  138. data/spec/lib/generators/starter_generator_spec.rb +54 -0
  139. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +7 -3
  140. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +23 -45
  141. data/spec/lib/twitter_bootstrap_rails/breadcrumbs_view_spec.rb +35 -0
  142. data/spec/lib/twitter_bootstrap_rails/flash_block_helper_spec.rb +26 -0
  143. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +2 -2
  144. data/spec/lib/twitter_bootstrap_rails/legacy_markup_spec.rb +74 -0
  145. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +21 -8
  146. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +94 -92
  147. data/spec/spec_helper.rb +5 -1
  148. data/spec/support/generator_spec_helper.rb +89 -0
  149. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap.bundle.min.js +3 -3
  150. data/vendor/assets/stylesheets/twitter/bootstrap/bootstrap.min.css +3 -3
  151. metadata +114 -120
  152. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  153. data/app/assets/fonts/glyphicons-halflings-regular.svg +0 -288
  154. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  155. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  156. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  157. data/app/helpers/glyph_helper.rb +0 -23
  158. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +0 -3
  159. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +0 -21
  160. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +0 -24
  161. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +0 -6684
  162. data/vendor/static-source/bootstrap.less +0 -1
  163. data/vendor/static-source/sprites.less +0 -6
  164. data/vendor/toolkit/twitter/bootstrap/alerts.less +0 -73
  165. data/vendor/toolkit/twitter/bootstrap/badges.less +0 -66
  166. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +0 -55
  167. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +0 -26
  168. data/vendor/toolkit/twitter/bootstrap/button-groups.less +0 -244
  169. data/vendor/toolkit/twitter/bootstrap/buttons.less +0 -166
  170. data/vendor/toolkit/twitter/bootstrap/carousel.less +0 -270
  171. data/vendor/toolkit/twitter/bootstrap/close.less +0 -34
  172. data/vendor/toolkit/twitter/bootstrap/code.less +0 -69
  173. data/vendor/toolkit/twitter/bootstrap/component-animations.less +0 -33
  174. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +0 -216
  175. data/vendor/toolkit/twitter/bootstrap/forms.less +0 -613
  176. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +0 -305
  177. data/vendor/toolkit/twitter/bootstrap/grid.less +0 -84
  178. data/vendor/toolkit/twitter/bootstrap/input-groups.less +0 -171
  179. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +0 -54
  180. data/vendor/toolkit/twitter/bootstrap/labels.less +0 -64
  181. data/vendor/toolkit/twitter/bootstrap/list-group.less +0 -130
  182. data/vendor/toolkit/twitter/bootstrap/media.less +0 -66
  183. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +0 -14
  184. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +0 -9
  185. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +0 -18
  186. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +0 -65
  187. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +0 -7
  188. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +0 -22
  189. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +0 -85
  190. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +0 -59
  191. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +0 -91
  192. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +0 -122
  193. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +0 -21
  194. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -33
  195. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +0 -12
  196. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +0 -30
  197. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +0 -10
  198. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +0 -9
  199. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +0 -8
  200. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +0 -24
  201. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +0 -24
  202. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +0 -10
  203. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +0 -8
  204. data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +0 -18
  205. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +0 -6
  206. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +0 -15
  207. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +0 -10
  208. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +0 -9
  209. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +0 -28
  210. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +0 -9
  211. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +0 -8
  212. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +0 -227
  213. data/vendor/toolkit/twitter/bootstrap/mixins.less +0 -40
  214. data/vendor/toolkit/twitter/bootstrap/modals.less +0 -150
  215. data/vendor/toolkit/twitter/bootstrap/navbar.less +0 -660
  216. data/vendor/toolkit/twitter/bootstrap/navs.less +0 -242
  217. data/vendor/toolkit/twitter/bootstrap/normalize.less +0 -424
  218. data/vendor/toolkit/twitter/bootstrap/pager.less +0 -54
  219. data/vendor/toolkit/twitter/bootstrap/pagination.less +0 -89
  220. data/vendor/toolkit/twitter/bootstrap/panels.less +0 -271
  221. data/vendor/toolkit/twitter/bootstrap/popovers.less +0 -131
  222. data/vendor/toolkit/twitter/bootstrap/print.less +0 -101
  223. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +0 -87
  224. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +0 -35
  225. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +0 -194
  226. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +0 -161
  227. data/vendor/toolkit/twitter/bootstrap/tables.less +0 -234
  228. data/vendor/toolkit/twitter/bootstrap/theme.less +0 -291
  229. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +0 -36
  230. data/vendor/toolkit/twitter/bootstrap/tooltip.less +0 -101
  231. data/vendor/toolkit/twitter/bootstrap/type.less +0 -302
  232. data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -55
  233. data/vendor/toolkit/twitter/bootstrap/variables.less +0 -1751
  234. data/vendor/toolkit/twitter/bootstrap/wells.less +0 -29
  235. data/vendor/toolkit/twitter/bootstrap_base.less +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91f5452759739c85c9a83fb03127e22cd959aa4f0818a42cd4991fa1b101af9d
4
- data.tar.gz: 4ffcbb99b350e7733cb7275f67b494df9195229a4a8114e5168850a67bfdf199
3
+ metadata.gz: e749f38d103c9081159cd686251b083119950e45ac05a07ffbec1fdc9998c718
4
+ data.tar.gz: b68354a498fbccd9f3332c3c28c1e34984d236cad0aaaaf24b521e32361700d2
5
5
  SHA512:
6
- metadata.gz: b10358a115e431626ad9d0ef2b59088db059f8ecb654ea46639fd944363b21ef773bb1e966df5b40f102dea2cd76e59262343a848afcc38a7ad58d36b93d24bc
7
- data.tar.gz: 56b8e90b7a75b0060acd5d47c08837f719a2161445b7f9445d16995c78224784684d0998e14a18da7af59c0465aa48cba0ec5d27b878fbce9f840d5ae4df5cc0
6
+ metadata.gz: d89262fa8b657f75f13f3be3f0550f0999e06e14a2de6bc6d76fdab6171639b5785cd7167118d90aef0dae928ecff7f526d3c3daf1e2b31cb568c252ca391c4d
7
+ data.tar.gz: deb6bc95b028221c973918da2f69df302b862552e12f5744c7735fabf32c00eab231c82855e4beb2f52dcb15239c7a9325583bff128df349f7a7bcd235fe7fb4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,127 @@
1
+ ## 5.5.0
2
+
3
+ ### Added
4
+
5
+ - **`rails g bootstrap:doctor`** checks how Bootstrap is set up in an app: whether
6
+ layouts load its CSS and JS, stale versions, an unrendered icon sprite, leftover
7
+ placeholder images, and markup from older Bootstrap versions with file and line.
8
+ `--json` prints a machine-readable report. It writes nothing and exits 1 if a
9
+ check reports an error.
10
+ - **`rails g bootstrap:agent`** writes a guide for coding agents, tailored to the
11
+ app: a Claude skill and a section in `AGENTS.md`. It keeps the rest of `AGENTS.md`
12
+ and replaces its own section when run again.
13
+ - **`--json`** on every snippet generator lists the variants as JSON.
14
+
15
+ ### Changed
16
+
17
+ - **View helpers now produce Bootstrap 5 markup.** They were still producing
18
+ Bootstrap 3 markup, so toggles, dropdowns and close buttons did nothing on the
19
+ Bootstrap 5 this gem ships. This changes their HTML, so custom CSS or tests that
20
+ rely on the old output need updating:
21
+ - `nav_bar` and the menu helpers use `navbar-expand`, `nav-item` and `nav-link`.
22
+ `:inverse` uses `data-bs-theme="dark"`, and `:static` no longer adds a class.
23
+ - `menu_item` puts `active` on the link rather than the `li`.
24
+ - `drop_down_submenu` renders a labelled group, because Bootstrap 5 has no nested
25
+ dropdowns.
26
+ - `menu_text` renders a `span`.
27
+ - `badge` and `tag_label` render `badge text-bg-*`, defaulting to `secondary`.
28
+ - `modal_toggle` and `modal_cancel_button` use `btn-secondary`, and the modal title
29
+ is an `h5`.
30
+ - `error_span` defaults to `invalid-feedback d-block` inside `has-validation`.
31
+ - `render_breadcrumbs` renders `nav > ol.breadcrumb`. The divider is set through
32
+ `--bs-breadcrumb-divider`, so `:divider_class` no longer applies.
33
+ - The Haml and Slim themed templates, the simple_form templates and the Devise login
34
+ partial now use Bootstrap 5 markup too.
35
+
36
+ ### Fixed
37
+
38
+ - `modal_cancel_button` raised `NoMethodError` on Rails 8.1.
39
+ - `modal_dialog` ignored `:size`.
40
+ - `close_button` didn't escape its dismiss target.
41
+ - `bootstrap_flash` dropped the `:class` option after the first message.
42
+ - `flash_block` used `alert-notice` and `alert-alert`, which don't exist.
43
+ - `render_breadcrumbs` ignored its default options, so the last crumb wasn't styled
44
+ as active.
45
+
46
+ ## 5.4.0
47
+
48
+ Bootstrap **5.3.8**. The gem version no longer tracks the Bootstrap version;
49
+ `Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION` is the authoritative statement of
50
+ which Bootstrap ships.
51
+
52
+ ### Breaking changes
53
+
54
+ - **Less is gone.** The `rails g bootstrap:install less` argument, the
55
+ `bootstrap_and_overrides.less` template, the Bootstrap 3 Less sources under
56
+ `vendor/toolkit` and `vendor/static-source`, and the `less-rails` and `execjs`
57
+ dependencies have all been removed. Bootstrap 5 has no Less build.
58
+ - **Glyphicons are gone.** `GlyphHelper#glyph` and the
59
+ `glyphicons-halflings-regular` font files have been removed. Bootstrap dropped
60
+ Glyphicons in v4; the helper emitted markup for icons that no longer resolve.
61
+ - **CoffeeScript support removed**, along with the `--no-coffeescript` option and
62
+ the `bootstrap.coffee` template.
63
+ - `rails g bootstrap:install` now takes `static` (default) or `cdn`.
64
+
65
+ ### Fixed
66
+
67
+ - `vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb` was
68
+ **Bootstrap 3.1.1** while occupying the same logical asset path as the
69
+ Bootstrap 5 file in `app/assets`. Whichever the asset pipeline resolved first
70
+ won. The stale Bootstrap 3 copy has been deleted.
71
+ - `bootstrap:install` checked `File.exist?` on paths relative to the working
72
+ directory rather than the destination root, so an app's existing
73
+ `application.js` / `application.css` were never detected and were overwritten
74
+ with the gem's template instead of having a require line inserted.
75
+ - `bootstrap:install` now raises a clear error when a vendored dist file is
76
+ missing from the gem, instead of creating empty directories and copying nothing.
77
+ - **`bootstrap:install static` shipped no Bootstrap at all on Rails 8.** Propshaft
78
+ (the Rails 8 default) has no Sprockets directives — a `//= require` line in a
79
+ manifest is an inert comment, served verbatim to the browser. The documented
80
+ default flow produced a completely unstyled app. `bootstrap:install` now detects
81
+ the pipeline: on Propshaft it vendors the dist files and skips the meaningless
82
+ manifests, and `bootstrap:layout` links them explicitly with
83
+ `stylesheet_link_tag "twitter/bootstrap/bootstrap.min"` /
84
+ `javascript_include_tag "twitter/bootstrap/bootstrap.bundle.min"`. Sprockets
85
+ apps keep the manifest `require` behaviour.
86
+ - On Sprockets apps whose `application.css` has no `require_self` directive to
87
+ anchor to, the require insertion silently did nothing. The generator now
88
+ prints the line to add by hand.
89
+ - `add_locale` re-inserted the locale file's own contents into itself when
90
+ `config/locales/en.bootstrap.yml` already existed.
91
+ - The generated layout loaded Bootstrap twice — a hardcoded CDN link *and*
92
+ `stylesheet_link_tag "application"`. It now emits one or the other.
93
+ - The `bootstrap.js` template called jQuery `.tooltip()` / `.popover()`, which
94
+ has not worked since Bootstrap 4. It now uses the Bootstrap 5 JS API.
95
+ - The Haml and Slim layouts still emitted Bootstrap 3 markup (`navbar-default`,
96
+ `.well`, `.icon-bar`) and an IE6-8 html5shiv. Both now match the ERB layout.
97
+
98
+ ### Added
99
+
100
+ - **Snippet generators.** Every snippet published at
101
+ [getbootstrap.com/docs/5.3/examples](https://getbootstrap.com/docs/5.3/examples/)
102
+ — 62 variants across 12 categories — is now a command that writes an `.html.erb`
103
+ partial: `bootstrap:header`, `bootstrap:hero`, `bootstrap:features`,
104
+ `bootstrap:sidebar`, `bootstrap:footer`, `bootstrap:dropdown`,
105
+ `bootstrap:list_group`, `bootstrap:modal`, `bootstrap:badge`,
106
+ `bootstrap:breadcrumb`, `bootstrap:button`, and `bootstrap:jumbotron`.
107
+ Each takes a variant name (`rails g bootstrap:header dark_search`), defaults to
108
+ the first variant on the docs page, and supports `--list`, `--as`, `--path`,
109
+ and `--no-icons`. Variant order matches the docs page order.
110
+ - Snippets that reference placeholder images from the Bootstrap docs site (which
111
+ 404 in a generated app) now warn at generate time instead of failing silently.
112
+ - The Bootstrap Icons sprite used by 36 of those snippets ships as
113
+ `_bootstrap_icons.html.erb`, installed automatically alongside any snippet that
114
+ needs it. Render it once in your layout.
115
+ - `rails g bootstrap:starter` — writes the starter template from the Bootstrap
116
+ docs to `public/bootstrap-starter.html` (`--path` to override).
117
+ - `rails g bootstrap:cdn` — prints the CDN tags for pasting into your own layout.
118
+ `--css`, `--js`, `--separate-popper`.
119
+ - `rails g bootstrap:layout --cdn` — link Bootstrap from jsDelivr with Subresource
120
+ Integrity instead of the asset pipeline. `--separate-popper` emits the Popper +
121
+ `bootstrap.js` pair instead of the bundle.
122
+ - `rails g bootstrap:install cdn` — records CDN mode in
123
+ `config/initializers/bootstrap.rb`, which `bootstrap:layout` then defaults to.
124
+
1
125
  <ul>
2
126
  <li>Version 5.3.1 - Documentation and packaging updates only; no library code changes since 5.3.0</li>
3
127
  <li>Version 5.3.0 - Bootstrap 5.3 assets, new generators, static asset fixes, requires Ruby >= 3.0, less-rails ~> 4.0</li>
data/README.md CHANGED
@@ -4,8 +4,17 @@
4
4
  [![GitHub stars](https://img.shields.io/github/stars/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/stargazers)
5
5
  [![GitHub forks](https://img.shields.io/github/forks/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/network)
6
6
  [![GitHub issues](https://img.shields.io/github/issues/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/issues)
7
+ [![Built with Claude Code](https://img.shields.io/badge/Built%20with-Claude%20Code-D97757?logo=claude&logoColor=white)](https://claude.com/claude-code)
7
8
 
8
- Integrates Bootstrap 5 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
9
+ Integrates Bootstrap 5.3.8 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
10
+ Tested against Rails 8.1.4.1 and 8.0.5.2.
11
+
12
+ > **Upgrade Rails.** [Rails 8.1.4.1 and 8.0.5.2](https://rubyonrails.org/2026/11/4/Rails-8.0.5.2-and-8.1.4.1-have-been-released)
13
+ > fix 21 security issues, and the Rails team strongly recommends upgrading as soon
14
+ > as possible. This gem's dependency range still allows older Rails versions, so
15
+ > installing it won't upgrade Rails for you. Run `bundle update rails` in your app.
16
+ > Security support for Rails 8.0 ends on 7 November 2026, and older series are
17
+ > already unsupported.
9
18
 
10
19
  ## Install
11
20
 
@@ -21,19 +30,155 @@ rails generate bootstrap:install static
21
30
 
22
31
  ## Generators
23
32
 
33
+ Every code snippet on the
34
+ [Bootstrap 5.3 Introduction page](https://getbootstrap.com/docs/5.3/getting-started/introduction/)
35
+ is reproducible from a command:
36
+
37
+ | Docs snippet | Command |
38
+ |---|---|
39
+ | Starter template | `rails g bootstrap:starter` |
40
+ | CDN CSS `<link>` | `rails g bootstrap:cdn --css` |
41
+ | CDN JS bundle `<script>` | `rails g bootstrap:cdn --js` |
42
+ | Popper + `bootstrap.js` separately | `rails g bootstrap:cdn --separate-popper` |
43
+ | Important globals (doctype, `lang`, viewport) | baked into every generated layout and the starter template |
44
+
24
45
  ```bash
25
- # Install Bootstrap assets
46
+ # Install Bootstrap assets into the asset pipeline
26
47
  rails g bootstrap:install static
27
48
 
28
- # Generate Bootstrap layout
49
+ # ...or load Bootstrap from the jsDelivr CDN instead
50
+ rails g bootstrap:install cdn
51
+
52
+ # Generate a Bootstrap layout
29
53
  rails g bootstrap:layout application
30
54
 
55
+ # ...linking Bootstrap from the CDN, with Subresource Integrity
56
+ rails g bootstrap:layout application --cdn
57
+
58
+ # ...using Popper and bootstrap.js separately rather than the bundle
59
+ rails g bootstrap:layout application --cdn --separate-popper
60
+
61
+ # Write the starter template from the Bootstrap docs
62
+ rails g bootstrap:starter # -> public/bootstrap-starter.html
63
+ rails g bootstrap:starter --path=public/demo.html
64
+
65
+ # Print CDN tags to paste into a layout you already own (writes nothing)
66
+ rails g bootstrap:cdn
67
+
31
68
  # Generate themed views for scaffold
32
69
  rails g scaffold Task title:string done:boolean
33
70
  rails db:migrate
34
71
  rails g bootstrap:themed Tasks
35
72
  ```
36
73
 
74
+ `bootstrap:install cdn` records the choice in `config/initializers/bootstrap.rb`,
75
+ so `bootstrap:layout` emits CDN tags by default afterwards. Pass `--cdn` or
76
+ `--no-cdn` to override it per run.
77
+
78
+ Both asset pipelines are supported. On **Sprockets**, `static` adds `require`
79
+ directives to your manifests. On **Propshaft** (the Rails 8 default) there are no
80
+ directives to add, so the generated layout links the vendored files directly —
81
+ run `rails g bootstrap:layout` after `bootstrap:install static` either way.
82
+
83
+ The Bootstrap version and its CDN URLs and integrity hashes live in one place,
84
+ `Twitter::Bootstrap::Rails::BOOTSTRAP_CDN`. No template hardcodes them.
85
+
86
+ ## Snippets
87
+
88
+ Every snippet published at
89
+ [getbootstrap.com/docs/5.3/examples](https://getbootstrap.com/docs/5.3/examples/)
90
+ — 62 of them across 12 categories — is a command. Each writes an `.html.erb`
91
+ partial into `app/views/shared/`:
92
+
93
+ ```bash
94
+ rails g bootstrap:header # the first variant, "centered"
95
+ rails g bootstrap:header dark_search # a specific variant
96
+ rails g bootstrap:header --list # what's available, with descriptions
97
+ ```
98
+
99
+ | Command | Variants |
100
+ |---|---|
101
+ | `rails g bootstrap:header` | `centered`, `nav_pills`, `with_auth_buttons`, `dark_search`, `light_search`, `grid_dropdown`, `double`, `dark_double` |
102
+ | `rails g bootstrap:hero` | `centered`, `centered_screenshot`, `with_image`, `signup_form`, `cropped_image`, `dark` |
103
+ | `rails g bootstrap:features` | `columns_with_icons`, `hanging_icons`, `custom_cards`, `icon_grid`, `with_title` |
104
+ | `rails g bootstrap:sidebar` | `dark`, `light`, `icon_only`, `collapsible`, `list_group` |
105
+ | `rails g bootstrap:footer` | `simple`, `with_brand`, `with_nav`, `columns`, `with_newsletter` |
106
+ | `rails g bootstrap:dropdown` | `simple`, `with_search`, `with_icons`, `calendar`, `mega_menu` |
107
+ | `rails g bootstrap:list_group` | `with_avatars`, `checkboxes`, `checkboxes_expanded`, `checkable`, `radios` |
108
+ | `rails g bootstrap:modal` | `sheet`, `confirm`, `whats_new`, `signup` |
109
+ | `rails g bootstrap:badge` | `pills`, `subtle`, `subtle_bordered`, `with_avatar`, `with_icons`, `with_avatar_divider` |
110
+ | `rails g bootstrap:breadcrumb` | `basic`, `with_icons`, `chevron`, `custom` |
111
+ | `rails g bootstrap:button` | `pills`, `grid`, `with_icons`, `loading`, `circle` |
112
+ | `rails g bootstrap:jumbotron` | `with_icon`, `placeholder`, `full_width`, `basic` |
113
+
114
+ Variants are listed in the order they appear on the docs page, so the first one
115
+ in each row is the first example Bootstrap shows.
116
+
117
+ Options, on every snippet command:
118
+
119
+ | Option | Effect |
120
+ |---|---|
121
+ | `--list` | Print the variants with descriptions and exit, writing nothing |
122
+ | `--json` | Print the variants as JSON and exit, writing nothing |
123
+ | `--as=NAME` | Partial name to write (default: the generator name) |
124
+ | `--path=DIR` | Where to write it (default: `app/views/shared`) |
125
+ | `--no-icons` | Skip installing the shared icon sprite |
126
+
127
+ ```bash
128
+ rails g bootstrap:footer columns --as=site_footer --path=app/views/layouts
129
+ # -> app/views/layouts/_site_footer.html.erb
130
+ ```
131
+
132
+ ### Placeholder images
133
+
134
+ Five snippets (`hero centered`, `hero centered_screenshot`, `hero with_image`,
135
+ `hero cropped_image`, `features custom_cards`) reference placeholder images that
136
+ only exist on Bootstrap's docs site, so they 404 until you point them at your own
137
+ assets. The generator warns you when you pick one.
138
+
139
+ ### Icons
140
+
141
+ 36 of the 62 snippets use Bootstrap Icons through an SVG sprite. Those commands
142
+ also write `_bootstrap_icons.html.erb` next to the partial. Render it **once**,
143
+ near the top of `<body>` in your layout, or those icons come out as empty boxes:
144
+
145
+ ```erb
146
+ <%= render "shared/bootstrap_icons" %>
147
+ ```
148
+
149
+ ## Coding agents
150
+
151
+ Agents like Claude Code, Cursor and Codex often write outdated Bootstrap from memory
152
+ or guess at an app's asset setup. These commands let them use what this gem already
153
+ knows instead. The gem doesn't call any AI service and needs no API key.
154
+
155
+ ```bash
156
+ rails g bootstrap:agent # write a guide tailored to this app
157
+ rails g bootstrap:doctor # check how Bootstrap is set up
158
+ rails g bootstrap:doctor --json # the same report, for agents and CI
159
+ rails g bootstrap:header --json # list a snippet's variants as JSON
160
+ ```
161
+
162
+ `bootstrap:agent` writes `.claude/skills/bootstrap-rails/SKILL.md` and a section in
163
+ `AGENTS.md`, keeping anything else in that file. Run it again after upgrading the gem
164
+ or changing your asset setup. Use `--no-claude` or `--no-agents` to skip either one.
165
+
166
+ `bootstrap:doctor` writes nothing and exits 1 if a check reports an error, so it also
167
+ works as a CI step. It checks:
168
+
169
+ | Check | Looks for |
170
+ |---|---|
171
+ | `bootstrap_css`, `bootstrap_js` | Whether your layouts actually load Bootstrap, on Propshaft, Sprockets or the CDN |
172
+ | `bootstrap_version` | CDN tags or vendored files on a different version from the one this gem ships |
173
+ | `icon_sprite` | The sprite being installed but never rendered, or rendered more than once |
174
+ | `placeholder_images` | Docs-site images left in your views |
175
+ | `legacy_markup` | Markup from older Bootstrap versions in `app/views`, `app/helpers` and `app/components`, with file, line and replacement |
176
+
177
+ In an existing app, `legacy_markup` works as a migration to-do list. Plain names like
178
+ `close` or `well` may be your own CSS classes, so check those before changing them.
179
+ If Bootstrap comes from `package.json` or your importmap, the doctor warns that it
180
+ can't verify it rather than reporting an error.
181
+
37
182
  ## Quick Start
38
183
 
39
184
  ```bash
@@ -49,6 +194,78 @@ rails generate bootstrap:layout application
49
194
  rails server
50
195
  ```
51
196
 
197
+ Run `bootstrap:layout` even if you already have a layout — that step is what puts
198
+ Bootstrap's CSS and JS on the page.
199
+
200
+ ## Upgrading to 5.5.0
201
+
202
+ 5.5.0 changes the HTML that the view helpers produce. They were still
203
+ writing Bootstrap 3 markup, so toggles, dropdowns and close buttons did nothing on
204
+ Bootstrap 5. If you have custom CSS or tests built on the old output, you'll need to
205
+ update them:
206
+
207
+ - `nav_bar` and the menu helpers use `navbar-expand`, `nav-item` and `nav-link`, and
208
+ `menu_item` puts `active` on the link rather than the `li`.
209
+ - `drop_down_submenu` renders a labelled group, because Bootstrap 5 has no nested
210
+ dropdowns.
211
+ - `badge` and `tag_label` render `badge text-bg-*`.
212
+ - `render_breadcrumbs` renders `nav > ol.breadcrumb`, and `:divider_class` no longer
213
+ applies.
214
+
215
+ See the [CHANGELOG](CHANGELOG.md) for the full list. `rails g bootstrap:doctor` finds
216
+ older Bootstrap markup in your own views and helpers.
217
+
218
+ ## Upgrading to 5.4.0
219
+
220
+ 5.4.0 is a breaking release:
221
+
222
+ - **Less is gone.** `rails g bootstrap:install less` no longer exists; the
223
+ argument is now `static` (default) or `cdn`. Bootstrap 5 has no Less build, and
224
+ the `less-rails` and `execjs` dependencies have been dropped.
225
+ - **Glyphicons are gone**, including the `glyph` helper. Bootstrap dropped them in
226
+ v4. The snippet generators ship Bootstrap Icons instead.
227
+ - **CoffeeScript support is gone**, along with `--no-coffeescript`.
228
+ - The gem version no longer tracks the Bootstrap version.
229
+ `Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION` says which Bootstrap ships.
230
+
231
+ If you are on Rails 8, note that `bootstrap:install static` previously left
232
+ Propshaft apps with no Bootstrap at all — that is fixed here. See the
233
+ [CHANGELOG](CHANGELOG.md) for the full list.
234
+
235
+ ## Sponsor
236
+
237
+ [![Open Collective](https://img.shields.io/badge/Open%20Collective-back%20this%20project-1F87FF?style=for-the-badge&logo=opencollective&logoColor=white)](https://opencollective.com/twitter-bootstrap-rails)
238
+ [![Patreon](https://img.shields.io/badge/Patreon-become%20a%20patron-FF424D?style=for-the-badge&logo=patreon&logoColor=white)](https://www.patreon.com/cw/seyhunak)
239
+
240
+ - [Open Collective](https://opencollective.com/twitter-bootstrap-rails) — back the project with a one-off or monthly contribution
241
+ - [Patreon](https://www.patreon.com/cw/seyhunak) — become a patron
242
+ - [Bootstrap 5 for Rails](https://www.patreon.com/seyhunak/posts/twitter-rails-5-165533952) — release write-up on Patreon
243
+
244
+ ## Buy me a Coffee
245
+ ## ☕ Support the Project
246
+
247
+ [![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S1B528UND3)
248
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=000000)](https://www.buymeacoffee.com/seyhunak)
249
+
250
+ ## Contributors
251
+
252
+ Thanks to all contributors who are helping to make better.
253
+
254
+ <a href="https://github.com/seyhunak/twitter-bootstrap-rails/graphs/contributors">
255
+ <img src="https://contrib.rocks/image?repo=seyhunak/twitter-bootstrap-rails" />
256
+ </a>
257
+
258
+ ### Star History
259
+
260
+ <a href="https://www.star-history.com/#seyhunak/twitter-bootstrap-rails&Date">
261
+ <picture>
262
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=seyhunak/twitter-bootstrap-rails&type=Date&theme=dark" />
263
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=seyhunak/twitter-bootstrap-rails&type=Date" />
264
+ <img alt="Star history of seyhunak/twitter-bootstrap-rails over time" src="https://api.star-history.com/svg?repos=seyhunak/twitter-bootstrap-rails&type=Date" />
265
+ </picture>
266
+ </a>
267
+
268
+
52
269
  ## License
53
270
 
54
- MIT
271
+ MIT. Copyright (c) 2025 (since 2011) by Seyhun Akyürek