twitter-bootstrap-rails 5.3.1 → 5.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +79 -0
- data/README.md +149 -3
- data/app/assets/javascripts/twitter/bootstrap/bootstrap.min.js +3 -3
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css +3 -3
- data/lib/generators/bootstrap/badge/badge_generator.rb +13 -0
- data/lib/generators/bootstrap/breadcrumb/breadcrumb_generator.rb +13 -0
- data/lib/generators/bootstrap/button/button_generator.rb +13 -0
- data/lib/generators/bootstrap/cdn/cdn_generator.rb +39 -0
- data/lib/generators/bootstrap/cdn_tags.rb +43 -0
- data/lib/generators/bootstrap/dropdown/dropdown_generator.rb +13 -0
- data/lib/generators/bootstrap/features/features_generator.rb +13 -0
- data/lib/generators/bootstrap/footer/footer_generator.rb +13 -0
- data/lib/generators/bootstrap/header/header_generator.rb +13 -0
- data/lib/generators/bootstrap/hero/hero_generator.rb +13 -0
- data/lib/generators/bootstrap/install/install_generator.rb +120 -61
- data/lib/generators/bootstrap/install/templates/application.js +1 -1
- data/lib/generators/bootstrap/install/templates/bootstrap.js +10 -3
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +2 -2
- data/lib/generators/bootstrap/jumbotron/jumbotron_generator.rb +13 -0
- data/lib/generators/bootstrap/layout/layout_generator.rb +65 -1
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +14 -9
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +28 -43
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +25 -40
- data/lib/generators/bootstrap/list_group/list_group_generator.rb +13 -0
- data/lib/generators/bootstrap/modal/modal_generator.rb +13 -0
- data/lib/generators/bootstrap/sidebar/sidebar_generator.rb +13 -0
- data/lib/generators/bootstrap/snippets/snippet_base.rb +126 -0
- data/lib/generators/bootstrap/snippets/snippet_catalog.rb +134 -0
- data/lib/generators/bootstrap/snippets/templates/badges/pills.html.erb +10 -0
- data/lib/generators/bootstrap/snippets/templates/badges/subtle.html.erb +10 -0
- data/lib/generators/bootstrap/snippets/templates/badges/subtle_bordered.html.erb +20 -0
- data/lib/generators/bootstrap/snippets/templates/badges/with_avatar.html.erb +34 -0
- data/lib/generators/bootstrap/snippets/templates/badges/with_avatar_divider.html.erb +66 -0
- data/lib/generators/bootstrap/snippets/templates/badges/with_icons.html.erb +26 -0
- data/lib/generators/bootstrap/snippets/templates/breadcrumbs/basic.html.erb +9 -0
- data/lib/generators/bootstrap/snippets/templates/breadcrumbs/chevron.html.erb +18 -0
- data/lib/generators/bootstrap/snippets/templates/breadcrumbs/custom.html.erb +18 -0
- data/lib/generators/bootstrap/snippets/templates/breadcrumbs/with_icons.html.erb +18 -0
- data/lib/generators/bootstrap/snippets/templates/buttons/circle.html.erb +20 -0
- data/lib/generators/bootstrap/snippets/templates/buttons/grid.html.erb +6 -0
- data/lib/generators/bootstrap/snippets/templates/buttons/loading.html.erb +10 -0
- data/lib/generators/bootstrap/snippets/templates/buttons/pills.html.erb +11 -0
- data/lib/generators/bootstrap/snippets/templates/buttons/with_icons.html.erb +14 -0
- data/lib/generators/bootstrap/snippets/templates/dropdowns/calendar.html.erb +156 -0
- data/lib/generators/bootstrap/snippets/templates/dropdowns/mega_menu.html.erb +140 -0
- data/lib/generators/bootstrap/snippets/templates/dropdowns/simple.html.erb +20 -0
- data/lib/generators/bootstrap/snippets/templates/dropdowns/with_icons.html.erb +88 -0
- data/lib/generators/bootstrap/snippets/templates/dropdowns/with_search.html.erb +64 -0
- data/lib/generators/bootstrap/snippets/templates/features/columns_with_icons.html.erb +46 -0
- data/lib/generators/bootstrap/snippets/templates/features/custom_cards.html.erb +79 -0
- data/lib/generators/bootstrap/snippets/templates/features/hanging_icons.html.erb +41 -0
- data/lib/generators/bootstrap/snippets/templates/features/icon_grid.html.erb +77 -0
- data/lib/generators/bootstrap/snippets/templates/features/with_title.html.erb +50 -0
- data/lib/generators/bootstrap/snippets/templates/footers/columns.html.erb +43 -0
- data/lib/generators/bootstrap/snippets/templates/footers/simple.html.erb +15 -0
- data/lib/generators/bootstrap/snippets/templates/footers/with_brand.html.erb +22 -0
- data/lib/generators/bootstrap/snippets/templates/footers/with_nav.html.erb +12 -0
- data/lib/generators/bootstrap/snippets/templates/footers/with_newsletter.html.erb +62 -0
- data/lib/generators/bootstrap/snippets/templates/headers/centered.html.erb +15 -0
- data/lib/generators/bootstrap/snippets/templates/headers/dark_double.html.erb +66 -0
- data/lib/generators/bootstrap/snippets/templates/headers/dark_search.html.erb +25 -0
- data/lib/generators/bootstrap/snippets/templates/headers/double.html.erb +28 -0
- data/lib/generators/bootstrap/snippets/templates/headers/grid_dropdown.html.erb +47 -0
- data/lib/generators/bootstrap/snippets/templates/headers/light_search.html.erb +34 -0
- data/lib/generators/bootstrap/snippets/templates/headers/nav_pills.html.erb +11 -0
- data/lib/generators/bootstrap/snippets/templates/headers/with_auth_buttons.html.erb +22 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/centered.html.erb +13 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/centered_screenshot.html.erb +17 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/cropped_image.html.erb +17 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/dark.html.erb +14 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/signup_form.html.erb +26 -0
- data/lib/generators/bootstrap/snippets/templates/heroes/with_image.html.erb +17 -0
- data/lib/generators/bootstrap/snippets/templates/icons/_bootstrap_icons.html.erb +134 -0
- data/lib/generators/bootstrap/snippets/templates/jumbotrons/basic.html.erb +10 -0
- data/lib/generators/bootstrap/snippets/templates/jumbotrons/full_width.html.erb +12 -0
- data/lib/generators/bootstrap/snippets/templates/jumbotrons/placeholder.html.erb +13 -0
- data/lib/generators/bootstrap/snippets/templates/jumbotrons/with_icon.html.erb +22 -0
- data/lib/generators/bootstrap/snippets/templates/list-groups/checkable.html.erb +24 -0
- data/lib/generators/bootstrap/snippets/templates/list-groups/checkboxes.html.erb +45 -0
- data/lib/generators/bootstrap/snippets/templates/list-groups/checkboxes_expanded.html.erb +52 -0
- data/lib/generators/bootstrap/snippets/templates/list-groups/radios.html.erb +32 -0
- data/lib/generators/bootstrap/snippets/templates/list-groups/with_avatars.html.erb +36 -0
- data/lib/generators/bootstrap/snippets/templates/modals/confirm.html.erb +18 -0
- data/lib/generators/bootstrap/snippets/templates/modals/sheet.html.erb +19 -0
- data/lib/generators/bootstrap/snippets/templates/modals/signup.html.erb +44 -0
- data/lib/generators/bootstrap/snippets/templates/modals/whats_new.html.erb +41 -0
- data/lib/generators/bootstrap/snippets/templates/sidebars/collapsible.html.erb +90 -0
- data/lib/generators/bootstrap/snippets/templates/sidebars/dark.html.erb +67 -0
- data/lib/generators/bootstrap/snippets/templates/sidebars/icon_only.html.erb +59 -0
- data/lib/generators/bootstrap/snippets/templates/sidebars/light.html.erb +67 -0
- data/lib/generators/bootstrap/snippets/templates/sidebars/list_group.html.erb +94 -0
- data/lib/generators/bootstrap/starter/starter_generator.rb +37 -0
- data/lib/generators/bootstrap/starter/templates/starter.html.erb +13 -0
- data/lib/twitter/bootstrap/rails/bootstrap.rb +1 -0
- data/lib/twitter/bootstrap/rails/config.rb +54 -0
- data/lib/twitter/bootstrap/rails/engine.rb +0 -8
- data/lib/twitter/bootstrap/rails/version.rb +28 -1
- data/lib/twitter-bootstrap-rails.rb +0 -1
- data/spec/lib/generators/cdn_generator_spec.rb +42 -0
- data/spec/lib/generators/install_generator_spec.rb +148 -0
- data/spec/lib/generators/layout_generator_spec.rb +124 -0
- data/spec/lib/generators/no_hardcoded_versions_spec.rb +45 -0
- data/spec/lib/generators/snippet_generators_spec.rb +201 -0
- data/spec/lib/generators/starter_generator_spec.rb +54 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/support/generator_spec_helper.rb +87 -0
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap.bundle.min.js +3 -3
- data/vendor/assets/stylesheets/twitter/bootstrap/bootstrap.min.css +3 -3
- metadata +99 -123
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +0 -288
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/helpers/glyph_helper.rb +0 -23
- data/lib/generators/bootstrap/install/templates/bootstrap.coffee +0 -3
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +0 -21
- data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +0 -24
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +0 -6684
- data/vendor/static-source/bootstrap.less +0 -1
- data/vendor/static-source/sprites.less +0 -6
- data/vendor/toolkit/twitter/bootstrap/alerts.less +0 -73
- data/vendor/toolkit/twitter/bootstrap/badges.less +0 -66
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +0 -55
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +0 -26
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +0 -244
- data/vendor/toolkit/twitter/bootstrap/buttons.less +0 -166
- data/vendor/toolkit/twitter/bootstrap/carousel.less +0 -270
- data/vendor/toolkit/twitter/bootstrap/close.less +0 -34
- data/vendor/toolkit/twitter/bootstrap/code.less +0 -69
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +0 -33
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +0 -216
- data/vendor/toolkit/twitter/bootstrap/forms.less +0 -613
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +0 -305
- data/vendor/toolkit/twitter/bootstrap/grid.less +0 -84
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +0 -171
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +0 -54
- data/vendor/toolkit/twitter/bootstrap/labels.less +0 -64
- data/vendor/toolkit/twitter/bootstrap/list-group.less +0 -130
- data/vendor/toolkit/twitter/bootstrap/media.less +0 -66
- data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +0 -14
- data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +0 -9
- data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +0 -18
- data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +0 -65
- data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +0 -7
- data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +0 -22
- data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +0 -85
- data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +0 -59
- data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +0 -91
- data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +0 -122
- data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +0 -21
- data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -33
- data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +0 -12
- data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +0 -30
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +0 -10
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +0 -9
- data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +0 -8
- data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +0 -24
- data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +0 -24
- data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +0 -10
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +0 -8
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +0 -18
- data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +0 -6
- data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +0 -15
- data/vendor/toolkit/twitter/bootstrap/mixins/size.less +0 -10
- data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +0 -9
- data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +0 -28
- data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +0 -9
- data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +0 -8
- data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +0 -227
- data/vendor/toolkit/twitter/bootstrap/mixins.less +0 -40
- data/vendor/toolkit/twitter/bootstrap/modals.less +0 -150
- data/vendor/toolkit/twitter/bootstrap/navbar.less +0 -660
- data/vendor/toolkit/twitter/bootstrap/navs.less +0 -242
- data/vendor/toolkit/twitter/bootstrap/normalize.less +0 -424
- data/vendor/toolkit/twitter/bootstrap/pager.less +0 -54
- data/vendor/toolkit/twitter/bootstrap/pagination.less +0 -89
- data/vendor/toolkit/twitter/bootstrap/panels.less +0 -271
- data/vendor/toolkit/twitter/bootstrap/popovers.less +0 -131
- data/vendor/toolkit/twitter/bootstrap/print.less +0 -101
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +0 -87
- data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +0 -35
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +0 -194
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +0 -161
- data/vendor/toolkit/twitter/bootstrap/tables.less +0 -234
- data/vendor/toolkit/twitter/bootstrap/theme.less +0 -291
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +0 -36
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +0 -101
- data/vendor/toolkit/twitter/bootstrap/type.less +0 -302
- data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -55
- data/vendor/toolkit/twitter/bootstrap/variables.less +0 -1751
- data/vendor/toolkit/twitter/bootstrap/wells.less +0 -29
- data/vendor/toolkit/twitter/bootstrap_base.less +0 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c179497e697969f22082029863a8961ef3bc5c662c7b62a108238dd14b72a9ac
|
|
4
|
+
data.tar.gz: 2500bd3b9f13b5a44d3a7403e9ab48b0d995ac9ede9605a21ffcf7257cd67dc2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b394fbf43caa16b0288e3357ec3c47745e1dc10c19149f18040a463165c0ca9a2e2843108db50c821941b01f800eb97f449e918056127ae90473cd39f466c8e7
|
|
7
|
+
data.tar.gz: 1c51ce6849e58c49b9017ac95d7b58bff2c44bb6b23eff6137120f43450cf645a9328d9218ec83c842c99885ae51b5f8453a2c96aa33cd90ab2f6bfba942b578
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
+
## 5.4.0
|
|
2
|
+
|
|
3
|
+
Bootstrap **5.3.8**. The gem version no longer tracks the Bootstrap version;
|
|
4
|
+
`Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION` is the authoritative statement of
|
|
5
|
+
which Bootstrap ships.
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- **Less is gone.** The `rails g bootstrap:install less` argument, the
|
|
10
|
+
`bootstrap_and_overrides.less` template, the Bootstrap 3 Less sources under
|
|
11
|
+
`vendor/toolkit` and `vendor/static-source`, and the `less-rails` and `execjs`
|
|
12
|
+
dependencies have all been removed. Bootstrap 5 has no Less build.
|
|
13
|
+
- **Glyphicons are gone.** `GlyphHelper#glyph` and the
|
|
14
|
+
`glyphicons-halflings-regular` font files have been removed. Bootstrap dropped
|
|
15
|
+
Glyphicons in v4; the helper emitted markup for icons that no longer resolve.
|
|
16
|
+
- **CoffeeScript support removed**, along with the `--no-coffeescript` option and
|
|
17
|
+
the `bootstrap.coffee` template.
|
|
18
|
+
- `rails g bootstrap:install` now takes `static` (default) or `cdn`.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb` was
|
|
23
|
+
**Bootstrap 3.1.1** while occupying the same logical asset path as the
|
|
24
|
+
Bootstrap 5 file in `app/assets`. Whichever the asset pipeline resolved first
|
|
25
|
+
won. The stale Bootstrap 3 copy has been deleted.
|
|
26
|
+
- `bootstrap:install` checked `File.exist?` on paths relative to the working
|
|
27
|
+
directory rather than the destination root, so an app's existing
|
|
28
|
+
`application.js` / `application.css` were never detected and were overwritten
|
|
29
|
+
with the gem's template instead of having a require line inserted.
|
|
30
|
+
- `bootstrap:install` now raises a clear error when a vendored dist file is
|
|
31
|
+
missing from the gem, instead of creating empty directories and copying nothing.
|
|
32
|
+
- **`bootstrap:install static` shipped no Bootstrap at all on Rails 8.** Propshaft
|
|
33
|
+
(the Rails 8 default) has no Sprockets directives — a `//= require` line in a
|
|
34
|
+
manifest is an inert comment, served verbatim to the browser. The documented
|
|
35
|
+
default flow produced a completely unstyled app. `bootstrap:install` now detects
|
|
36
|
+
the pipeline: on Propshaft it vendors the dist files and skips the meaningless
|
|
37
|
+
manifests, and `bootstrap:layout` links them explicitly with
|
|
38
|
+
`stylesheet_link_tag "twitter/bootstrap/bootstrap.min"` /
|
|
39
|
+
`javascript_include_tag "twitter/bootstrap/bootstrap.bundle.min"`. Sprockets
|
|
40
|
+
apps keep the manifest `require` behaviour.
|
|
41
|
+
- On Sprockets apps whose `application.css` has no `require_self` directive to
|
|
42
|
+
anchor to, the require insertion silently did nothing. The generator now
|
|
43
|
+
prints the line to add by hand.
|
|
44
|
+
- `add_locale` re-inserted the locale file's own contents into itself when
|
|
45
|
+
`config/locales/en.bootstrap.yml` already existed.
|
|
46
|
+
- The generated layout loaded Bootstrap twice — a hardcoded CDN link *and*
|
|
47
|
+
`stylesheet_link_tag "application"`. It now emits one or the other.
|
|
48
|
+
- The `bootstrap.js` template called jQuery `.tooltip()` / `.popover()`, which
|
|
49
|
+
has not worked since Bootstrap 4. It now uses the Bootstrap 5 JS API.
|
|
50
|
+
- The Haml and Slim layouts still emitted Bootstrap 3 markup (`navbar-default`,
|
|
51
|
+
`.well`, `.icon-bar`) and an IE6-8 html5shiv. Both now match the ERB layout.
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- **Snippet generators.** Every snippet published at
|
|
56
|
+
[getbootstrap.com/docs/5.3/examples](https://getbootstrap.com/docs/5.3/examples/)
|
|
57
|
+
— 62 variants across 12 categories — is now a command that writes an `.html.erb`
|
|
58
|
+
partial: `bootstrap:header`, `bootstrap:hero`, `bootstrap:features`,
|
|
59
|
+
`bootstrap:sidebar`, `bootstrap:footer`, `bootstrap:dropdown`,
|
|
60
|
+
`bootstrap:list_group`, `bootstrap:modal`, `bootstrap:badge`,
|
|
61
|
+
`bootstrap:breadcrumb`, `bootstrap:button`, and `bootstrap:jumbotron`.
|
|
62
|
+
Each takes a variant name (`rails g bootstrap:header dark_search`), defaults to
|
|
63
|
+
the first variant on the docs page, and supports `--list`, `--as`, `--path`,
|
|
64
|
+
and `--no-icons`. Variant order matches the docs page order.
|
|
65
|
+
- Snippets that reference placeholder images from the Bootstrap docs site (which
|
|
66
|
+
404 in a generated app) now warn at generate time instead of failing silently.
|
|
67
|
+
- The Bootstrap Icons sprite used by 36 of those snippets ships as
|
|
68
|
+
`_bootstrap_icons.html.erb`, installed automatically alongside any snippet that
|
|
69
|
+
needs it. Render it once in your layout.
|
|
70
|
+
- `rails g bootstrap:starter` — writes the starter template from the Bootstrap
|
|
71
|
+
docs to `public/bootstrap-starter.html` (`--path` to override).
|
|
72
|
+
- `rails g bootstrap:cdn` — prints the CDN tags for pasting into your own layout.
|
|
73
|
+
`--css`, `--js`, `--separate-popper`.
|
|
74
|
+
- `rails g bootstrap:layout --cdn` — link Bootstrap from jsDelivr with Subresource
|
|
75
|
+
Integrity instead of the asset pipeline. `--separate-popper` emits the Popper +
|
|
76
|
+
`bootstrap.js` pair instead of the bundle.
|
|
77
|
+
- `rails g bootstrap:install cdn` — records CDN mode in
|
|
78
|
+
`config/initializers/bootstrap.rb`, which `bootstrap:layout` then defaults to.
|
|
79
|
+
|
|
1
80
|
<ul>
|
|
2
81
|
<li>Version 5.3.1 - Documentation and packaging updates only; no library code changes since 5.3.0</li>
|
|
3
82
|
<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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/seyhunak/twitter-bootstrap-rails/network)
|
|
6
6
|
[](https://github.com/seyhunak/twitter-bootstrap-rails/issues)
|
|
7
7
|
|
|
8
|
-
Integrates Bootstrap 5 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
|
|
8
|
+
Integrates Bootstrap 5.3.8 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -21,19 +21,121 @@ rails generate bootstrap:install static
|
|
|
21
21
|
|
|
22
22
|
## Generators
|
|
23
23
|
|
|
24
|
+
Every code snippet on the
|
|
25
|
+
[Bootstrap 5.3 Introduction page](https://getbootstrap.com/docs/5.3/getting-started/introduction/)
|
|
26
|
+
is reproducible from a command:
|
|
27
|
+
|
|
28
|
+
| Docs snippet | Command |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Starter template | `rails g bootstrap:starter` |
|
|
31
|
+
| CDN CSS `<link>` | `rails g bootstrap:cdn --css` |
|
|
32
|
+
| CDN JS bundle `<script>` | `rails g bootstrap:cdn --js` |
|
|
33
|
+
| Popper + `bootstrap.js` separately | `rails g bootstrap:cdn --separate-popper` |
|
|
34
|
+
| Important globals (doctype, `lang`, viewport) | baked into every generated layout and the starter template |
|
|
35
|
+
|
|
24
36
|
```bash
|
|
25
|
-
# Install Bootstrap assets
|
|
37
|
+
# Install Bootstrap assets into the asset pipeline
|
|
26
38
|
rails g bootstrap:install static
|
|
27
39
|
|
|
28
|
-
#
|
|
40
|
+
# ...or load Bootstrap from the jsDelivr CDN instead
|
|
41
|
+
rails g bootstrap:install cdn
|
|
42
|
+
|
|
43
|
+
# Generate a Bootstrap layout
|
|
29
44
|
rails g bootstrap:layout application
|
|
30
45
|
|
|
46
|
+
# ...linking Bootstrap from the CDN, with Subresource Integrity
|
|
47
|
+
rails g bootstrap:layout application --cdn
|
|
48
|
+
|
|
49
|
+
# ...using Popper and bootstrap.js separately rather than the bundle
|
|
50
|
+
rails g bootstrap:layout application --cdn --separate-popper
|
|
51
|
+
|
|
52
|
+
# Write the starter template from the Bootstrap docs
|
|
53
|
+
rails g bootstrap:starter # -> public/bootstrap-starter.html
|
|
54
|
+
rails g bootstrap:starter --path=public/demo.html
|
|
55
|
+
|
|
56
|
+
# Print CDN tags to paste into a layout you already own (writes nothing)
|
|
57
|
+
rails g bootstrap:cdn
|
|
58
|
+
|
|
31
59
|
# Generate themed views for scaffold
|
|
32
60
|
rails g scaffold Task title:string done:boolean
|
|
33
61
|
rails db:migrate
|
|
34
62
|
rails g bootstrap:themed Tasks
|
|
35
63
|
```
|
|
36
64
|
|
|
65
|
+
`bootstrap:install cdn` records the choice in `config/initializers/bootstrap.rb`,
|
|
66
|
+
so `bootstrap:layout` emits CDN tags by default afterwards. Pass `--cdn` or
|
|
67
|
+
`--no-cdn` to override it per run.
|
|
68
|
+
|
|
69
|
+
Both asset pipelines are supported. On **Sprockets**, `static` adds `require`
|
|
70
|
+
directives to your manifests. On **Propshaft** (the Rails 8 default) there are no
|
|
71
|
+
directives to add, so the generated layout links the vendored files directly —
|
|
72
|
+
run `rails g bootstrap:layout` after `bootstrap:install static` either way.
|
|
73
|
+
|
|
74
|
+
The Bootstrap version and its CDN URLs and integrity hashes live in one place,
|
|
75
|
+
`Twitter::Bootstrap::Rails::BOOTSTRAP_CDN`. No template hardcodes them.
|
|
76
|
+
|
|
77
|
+
## Snippets
|
|
78
|
+
|
|
79
|
+
Every snippet published at
|
|
80
|
+
[getbootstrap.com/docs/5.3/examples](https://getbootstrap.com/docs/5.3/examples/)
|
|
81
|
+
— 62 of them across 12 categories — is a command. Each writes an `.html.erb`
|
|
82
|
+
partial into `app/views/shared/`:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
rails g bootstrap:header # the first variant, "centered"
|
|
86
|
+
rails g bootstrap:header dark_search # a specific variant
|
|
87
|
+
rails g bootstrap:header --list # what's available, with descriptions
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
| Command | Variants |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `rails g bootstrap:header` | `centered`, `nav_pills`, `with_auth_buttons`, `dark_search`, `light_search`, `grid_dropdown`, `double`, `dark_double` |
|
|
93
|
+
| `rails g bootstrap:hero` | `centered`, `centered_screenshot`, `with_image`, `signup_form`, `cropped_image`, `dark` |
|
|
94
|
+
| `rails g bootstrap:features` | `columns_with_icons`, `hanging_icons`, `custom_cards`, `icon_grid`, `with_title` |
|
|
95
|
+
| `rails g bootstrap:sidebar` | `dark`, `light`, `icon_only`, `collapsible`, `list_group` |
|
|
96
|
+
| `rails g bootstrap:footer` | `simple`, `with_brand`, `with_nav`, `columns`, `with_newsletter` |
|
|
97
|
+
| `rails g bootstrap:dropdown` | `simple`, `with_search`, `with_icons`, `calendar`, `mega_menu` |
|
|
98
|
+
| `rails g bootstrap:list_group` | `with_avatars`, `checkboxes`, `checkboxes_expanded`, `checkable`, `radios` |
|
|
99
|
+
| `rails g bootstrap:modal` | `sheet`, `confirm`, `whats_new`, `signup` |
|
|
100
|
+
| `rails g bootstrap:badge` | `pills`, `subtle`, `subtle_bordered`, `with_avatar`, `with_icons`, `with_avatar_divider` |
|
|
101
|
+
| `rails g bootstrap:breadcrumb` | `basic`, `with_icons`, `chevron`, `custom` |
|
|
102
|
+
| `rails g bootstrap:button` | `pills`, `grid`, `with_icons`, `loading`, `circle` |
|
|
103
|
+
| `rails g bootstrap:jumbotron` | `with_icon`, `placeholder`, `full_width`, `basic` |
|
|
104
|
+
|
|
105
|
+
Variants are listed in the order they appear on the docs page, so the first one
|
|
106
|
+
in each row is the first example Bootstrap shows.
|
|
107
|
+
|
|
108
|
+
Options, on every snippet command:
|
|
109
|
+
|
|
110
|
+
| Option | Effect |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `--list` | Print the variants with descriptions and exit, writing nothing |
|
|
113
|
+
| `--as=NAME` | Partial name to write (default: the generator name) |
|
|
114
|
+
| `--path=DIR` | Where to write it (default: `app/views/shared`) |
|
|
115
|
+
| `--no-icons` | Skip installing the shared icon sprite |
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
rails g bootstrap:footer columns --as=site_footer --path=app/views/layouts
|
|
119
|
+
# -> app/views/layouts/_site_footer.html.erb
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Placeholder images
|
|
123
|
+
|
|
124
|
+
Five snippets (`hero centered`, `hero centered_screenshot`, `hero with_image`,
|
|
125
|
+
`hero cropped_image`, `features custom_cards`) reference placeholder images that
|
|
126
|
+
only exist on Bootstrap's docs site, so they 404 until you point them at your own
|
|
127
|
+
assets. The generator warns you when you pick one.
|
|
128
|
+
|
|
129
|
+
### Icons
|
|
130
|
+
|
|
131
|
+
36 of the 62 snippets use Bootstrap Icons through an SVG sprite. Those commands
|
|
132
|
+
also write `_bootstrap_icons.html.erb` next to the partial. Render it **once**,
|
|
133
|
+
near the top of `<body>` in your layout, or those icons come out as empty boxes:
|
|
134
|
+
|
|
135
|
+
```erb
|
|
136
|
+
<%= render "shared/bootstrap_icons" %>
|
|
137
|
+
```
|
|
138
|
+
|
|
37
139
|
## Quick Start
|
|
38
140
|
|
|
39
141
|
```bash
|
|
@@ -49,6 +151,50 @@ rails generate bootstrap:layout application
|
|
|
49
151
|
rails server
|
|
50
152
|
```
|
|
51
153
|
|
|
154
|
+
Run `bootstrap:layout` even if you already have a layout — that step is what puts
|
|
155
|
+
Bootstrap's CSS and JS on the page.
|
|
156
|
+
|
|
157
|
+
## Upgrading to 5.4.0
|
|
158
|
+
|
|
159
|
+
5.4.0 is a breaking release:
|
|
160
|
+
|
|
161
|
+
- **Less is gone.** `rails g bootstrap:install less` no longer exists; the
|
|
162
|
+
argument is now `static` (default) or `cdn`. Bootstrap 5 has no Less build, and
|
|
163
|
+
the `less-rails` and `execjs` dependencies have been dropped.
|
|
164
|
+
- **Glyphicons are gone**, including the `glyph` helper. Bootstrap dropped them in
|
|
165
|
+
v4. The snippet generators ship Bootstrap Icons instead.
|
|
166
|
+
- **CoffeeScript support is gone**, along with `--no-coffeescript`.
|
|
167
|
+
- The gem version no longer tracks the Bootstrap version.
|
|
168
|
+
`Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION` says which Bootstrap ships.
|
|
169
|
+
|
|
170
|
+
If you are on Rails 8, note that `bootstrap:install static` previously left
|
|
171
|
+
Propshaft apps with no Bootstrap at all — that is fixed here. See the
|
|
172
|
+
[CHANGELOG](CHANGELOG.md) for the full list.
|
|
173
|
+
|
|
174
|
+
## Buy me a Coffee
|
|
175
|
+
## ☕ Support the Project
|
|
176
|
+
|
|
177
|
+
[](https://www.buymeacoffee.com/seyhunak)
|
|
178
|
+
|
|
179
|
+
## Contributors
|
|
180
|
+
|
|
181
|
+
Thanks to all contributors who are helping to make better.
|
|
182
|
+
|
|
183
|
+
<a href="https://github.com/seyhunak/twitter-bootstrap-rails/graphs/contributors">
|
|
184
|
+
<img src="https://contrib.rocks/image?repo=seyhunak/twitter-bootstrap-rails" />
|
|
185
|
+
</a>
|
|
186
|
+
|
|
187
|
+
### Star History
|
|
188
|
+
|
|
189
|
+
<a href="https://www.star-history.com/#seyhunak/twitter-bootstrap-rails&Date">
|
|
190
|
+
<picture>
|
|
191
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=seyhunak/twitter-bootstrap-rails&type=Date&theme=dark" />
|
|
192
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=seyhunak/twitter-bootstrap-rails&type=Date" />
|
|
193
|
+
<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" />
|
|
194
|
+
</picture>
|
|
195
|
+
</a>
|
|
196
|
+
|
|
197
|
+
|
|
52
198
|
## License
|
|
53
199
|
|
|
54
200
|
MIT
|