bootstrap_styleguide 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +31 -0
  4. data/Rakefile +18 -0
  5. data/app/assets/config/bootstrap_styleguide_manifest.js +1 -0
  6. data/app/assets/stylesheets/bootstrap_styleguide/application.css +15 -0
  7. data/app/controllers/bootstrap_styleguide/application_controller.rb +5 -0
  8. data/app/controllers/bootstrap_styleguide/components_controller.rb +5 -0
  9. data/app/controllers/bootstrap_styleguide/content_controller.rb +5 -0
  10. data/app/controllers/bootstrap_styleguide/forms_controller.rb +5 -0
  11. data/app/controllers/bootstrap_styleguide/layout_controller.rb +5 -0
  12. data/app/controllers/bootstrap_styleguide/styleguide_controller.rb +6 -0
  13. data/app/controllers/bootstrap_styleguide/utilities_controller.rb +5 -0
  14. data/app/helpers/bootstrap_styleguide/application_helper.rb +37 -0
  15. data/app/jobs/bootstrap_styleguide/application_job.rb +4 -0
  16. data/app/mailers/bootstrap_styleguide/application_mailer.rb +6 -0
  17. data/app/models/bootstrap_styleguide/application_record.rb +5 -0
  18. data/app/views/bootstrap_styleguide/components/accordion.html.erb +47 -0
  19. data/app/views/bootstrap_styleguide/components/alerts.html.erb +33 -0
  20. data/app/views/bootstrap_styleguide/components/badge.html.erb +41 -0
  21. data/app/views/bootstrap_styleguide/components/breadcrumbs.html.erb +42 -0
  22. data/app/views/bootstrap_styleguide/components/button_group.html.erb +67 -0
  23. data/app/views/bootstrap_styleguide/components/buttons.html.erb +43 -0
  24. data/app/views/bootstrap_styleguide/components/cards.html.erb +72 -0
  25. data/app/views/bootstrap_styleguide/components/carousel.html.erb +5 -0
  26. data/app/views/bootstrap_styleguide/components/close_button.html.erb +10 -0
  27. data/app/views/bootstrap_styleguide/components/collapse.html.erb +59 -0
  28. data/app/views/bootstrap_styleguide/components/dropdowns.html.erb +44 -0
  29. data/app/views/bootstrap_styleguide/components/modal.html.erb +63 -0
  30. data/app/views/bootstrap_styleguide/components/navbar.html.erb +44 -0
  31. data/app/views/bootstrap_styleguide/components/navs_and_tabs.html.erb +65 -0
  32. data/app/views/bootstrap_styleguide/components/offcanvas.html.erb +69 -0
  33. data/app/views/bootstrap_styleguide/components/pagination.html.erb +46 -0
  34. data/app/views/bootstrap_styleguide/components/popovers.html.erb +26 -0
  35. data/app/views/bootstrap_styleguide/components/progress.html.erb +61 -0
  36. data/app/views/bootstrap_styleguide/components/spinners.html.erb +62 -0
  37. data/app/views/bootstrap_styleguide/components/toasts.html.erb +58 -0
  38. data/app/views/bootstrap_styleguide/components/tooltips.html.erb +20 -0
  39. data/app/views/bootstrap_styleguide/content/images.html.erb +5 -0
  40. data/app/views/bootstrap_styleguide/content/tables.html.erb +74 -0
  41. data/app/views/bootstrap_styleguide/content/typography.html.erb +68 -0
  42. data/app/views/bootstrap_styleguide/forms/checks_and_radios.html.erb +58 -0
  43. data/app/views/bootstrap_styleguide/forms/floating_labels.html.erb +60 -0
  44. data/app/views/bootstrap_styleguide/forms/input_group.html.erb +30 -0
  45. data/app/views/bootstrap_styleguide/forms/range.html.erb +11 -0
  46. data/app/views/bootstrap_styleguide/forms/select.html.erb +34 -0
  47. data/app/views/bootstrap_styleguide/layout/breakpoints.html.erb +49 -0
  48. data/app/views/bootstrap_styleguide/layout/containers.html.erb +111 -0
  49. data/app/views/bootstrap_styleguide/layout/grid.html.erb +51 -0
  50. data/app/views/bootstrap_styleguide/styleguide/index.html.erb +24 -0
  51. data/app/views/bootstrap_styleguide/utilities/background.html.erb +38 -0
  52. data/app/views/bootstrap_styleguide/utilities/borders.html.erb +67 -0
  53. data/app/views/bootstrap_styleguide/utilities/colors.html.erb +26 -0
  54. data/app/views/bootstrap_styleguide/utilities/shadows.html.erb +13 -0
  55. data/app/views/bootstrap_styleguide/utilities/spacing.html.erb +37 -0
  56. data/app/views/bootstrap_styleguide/utilities/text.html.erb +25 -0
  57. data/app/views/layouts/_styleguide_header.html.erb +71 -0
  58. data/app/views/layouts/styleguide.html.erb +19 -0
  59. data/config/routes.rb +47 -0
  60. data/lib/bootstrap_styleguide/engine.rb +5 -0
  61. data/lib/bootstrap_styleguide/version.rb +3 -0
  62. data/lib/bootstrap_styleguide.rb +6 -0
  63. data/lib/generators/bootstrap_styleguide/install_generator.rb +22 -0
  64. data/lib/tasks/bootstrap_styleguide_tasks.rake +4 -0
  65. metadata +123 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4e07ba219915a8ea0856974ab8abe245b8307880572ea14884c6d7c65fb93700
4
+ data.tar.gz: 5360c3f70fefb9e1bb224c8f0b341c21e386175372a3bf052ec38aee1eac7924
5
+ SHA512:
6
+ metadata.gz: 22845b381ed47f6722109a8fd1ba3ed08a58c5bb11ecd74b2659d9306c884e46b5614e5d707ecec017df9152d485b28730e853c06da0a4bb6b18199934134bd2
7
+ data.tar.gz: e880836d535c4dac0ab8b86d9c4ffbc22528aca9228e77a700d282909eab9d557893b17586b472c7a870b3c9cd2238139b384c39656f3281382578c818f58922
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2021 santiago bertinat
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # BootstrapStyleguide
2
+ Bootstrap Styleguide is an easy way to generate a complete styleguide for your rails + bootstrap proyect.
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'bootstrap_styleguide'
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $ bundle install
14
+ ```
15
+
16
+ Or install it yourself as:
17
+ ```bash
18
+ $ gem install bootstrap_styleguide
19
+ ```
20
+
21
+ If you want to override the styleguide views and add your custom styles and components please run:
22
+
23
+ ```bash
24
+ $ rails generate bootstrap_styleguide:install
25
+ ```
26
+
27
+ ## Contributing
28
+ Contribution directions go here.
29
+
30
+ ## License
31
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require 'bundler/setup'
2
+
3
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
4
+ load 'rails/tasks/engine.rake'
5
+
6
+ load 'rails/tasks/statistics.rake'
7
+
8
+ require 'bundler/gem_tasks'
9
+
10
+ require 'rake/testtask'
11
+
12
+ Rake::TestTask.new(:test) do |t|
13
+ t.libs << 'test'
14
+ t.pattern = 'test/**/*_test.rb'
15
+ t.verbose = false
16
+ end
17
+
18
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/bootstrap_styleguide .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class ApplicationController < ActionController::Base
3
+ layout 'styleguide'
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class ComponentsController < ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class ContentController < ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class FormsController < ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class LayoutController < ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module BootstrapStyleguide
2
+ class StyleguideController < ApplicationController
3
+ def index
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class UtilitiesController < ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,37 @@
1
+ module BootstrapStyleguide
2
+ module ApplicationHelper
3
+ def layout_items
4
+ [:breakpoints, :containers, :grid]
5
+ end
6
+
7
+ def content_items
8
+ [:typography, :images, :tables]
9
+ end
10
+
11
+ def forms_items
12
+ [:select, :checks_and_radios, :range, :input_group, :floating_labels]
13
+ end
14
+
15
+ def components_items
16
+ [
17
+ :accordion, :alerts, :badge, :breadcrumbs, :buttons, :button_group, :cards, :carousel,
18
+ :close_button, :collapse, :dropdowns, :modal, :navs_and_tabs, :navbar, :offcanvas, :pagination,
19
+ :popovers, :progress, :spinners, :toasts, :tooltips
20
+ ]
21
+ end
22
+
23
+ def utilities_items
24
+ [:background, :borders, :colors, :shadows, :spacing, :text]
25
+ end
26
+
27
+ def example_with_code(&block)
28
+ content = capture(&block)
29
+
30
+ content += tag.pre class: 'bg-light-gray mt-3 pb-3' do
31
+ tag.code do
32
+ "#{content}"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,4 @@
1
+ module BootstrapStyleguide
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module BootstrapStyleguide
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module BootstrapStyleguide
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,47 @@
1
+ <h1 id="content">Accordion</h1>
2
+ <p class="bd-lead">Build vertically collapsing accordions in combination with our Collapse JavaScript plugin.</p>
3
+
4
+ <h2>Example</h2>
5
+
6
+ <p>Click the accordions below to expand/collapse the accordion content.</p>
7
+
8
+ <%= example_with_code do %>
9
+ <div class="accordion" id="accordionExample">
10
+ <div class="accordion-item">
11
+ <h2 class="accordion-header" id="headingOne">
12
+ <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
13
+ Accordion Item #1
14
+ </button>
15
+ </h2>
16
+ <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
17
+ <div class="accordion-body">
18
+ <strong>This is the first item's accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <div class="accordion-item">
23
+ <h2 class="accordion-header" id="headingTwo">
24
+ <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
25
+ Accordion Item #2
26
+ </button>
27
+ </h2>
28
+ <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
29
+ <div class="accordion-body">
30
+ <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="accordion-item">
35
+ <h2 class="accordion-header" id="headingThree">
36
+ <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
37
+ Accordion Item #3
38
+ </button>
39
+ </h2>
40
+ <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
41
+ <div class="accordion-body">
42
+ <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <h1 id="content">Alerts</h1>
2
+ <p class="bd-lead">Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p>
3
+
4
+ <h2>Example</h2>
5
+
6
+ <p>Alerts are available for any length of text, as well as an optional close button. For proper styling, use one of the eight <strong>required</strong> contextual classes (e.g., <code>.alert-success</code>).</p>
7
+
8
+ <%= example_with_code do %>
9
+ <div class="alert alert-primary" role="alert">
10
+ A simple primary alert—check it out!
11
+ </div>
12
+ <div class="alert alert-secondary" role="alert">
13
+ A simple secondary alert—check it out!
14
+ </div>
15
+ <div class="alert alert-success" role="alert">
16
+ A simple success alert—check it out!
17
+ </div>
18
+ <div class="alert alert-danger" role="alert">
19
+ A simple danger alert—check it out!
20
+ </div>
21
+ <div class="alert alert-warning" role="alert">
22
+ A simple warning alert—check it out!
23
+ </div>
24
+ <div class="alert alert-info" role="alert">
25
+ A simple info alert—check it out!
26
+ </div>
27
+ <div class="alert alert-light" role="alert">
28
+ A simple light alert—check it out!
29
+ </div>
30
+ <div class="alert alert-dark" role="alert">
31
+ A simple dark alert—check it out!
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,41 @@
1
+ <h1 id="content">Badges</h1>
2
+ <p class="bd-lead">Documentation and examples for badges, our small count and labeling component.</p>
3
+
4
+ <h2>Example</h2>
5
+
6
+ <p>Badges scale to match the size of the immediate parent element by using relative font sizing and em units. As of v5, badges no longer have focus or hover styles for links.</p>
7
+
8
+ <h3>Headings</h3>
9
+
10
+ <%= example_with_code do %>
11
+ <h1>Example heading <span class="badge bg-secondary">New</span></h1>
12
+ <h2>Example heading <span class="badge bg-secondary">New</span></h2>
13
+ <h3>Example heading <span class="badge bg-secondary">New</span></h3>
14
+ <h4>Example heading <span class="badge bg-secondary">New</span></h4>
15
+ <h5>Example heading <span class="badge bg-secondary">New</span></h5>
16
+ <h6>Example heading <span class="badge bg-secondary">New</span></h6>
17
+ <% end %>
18
+
19
+ <h3>Buttons</h3>
20
+
21
+ <p>Badges can be used as part of links or buttons to provide a counter.</p>
22
+
23
+ <%= example_with_code do %>
24
+ <button type="button" class="btn btn-primary">
25
+ Notifications <span class="badge bg-secondary">4</span>
26
+ </button>
27
+ <% end %>
28
+
29
+ <h3>Positioned</h3>
30
+
31
+ <p>Use utilities to modify a <code>.badge</code> and position it in the corner of a link or button.</p>
32
+
33
+ <%= example_with_code do %>
34
+ <button type="button" class="btn btn-primary position-relative">
35
+ Inbox
36
+ <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
37
+ 99+
38
+ <span class="visually-hidden">unread messages</span>
39
+ </span>
40
+ </button>
41
+ <% end %>
@@ -0,0 +1,42 @@
1
+ <h1 id="content">Breadcrumb</h1>
2
+ <p class="bd-lead">Indicate the current page’s location within a navigational hierarchy that automatically adds separators via CSS.</p>
3
+
4
+ <h2>Example</h2>
5
+
6
+ <p>Use an ordered or unordered list with linked list items to create a minimally styled breadcrumb. Use our utilities to add additional styles as desired.</p>
7
+
8
+ <%= example_with_code do %>
9
+ <nav aria-label="breadcrumb">
10
+ <ol class="breadcrumb">
11
+ <li class="breadcrumb-item active" aria-current="page">Home</li>
12
+ </ol>
13
+ </nav>
14
+
15
+ <nav aria-label="breadcrumb">
16
+ <ol class="breadcrumb">
17
+ <li class="breadcrumb-item"><a href="#">Home</a></li>
18
+ <li class="breadcrumb-item active" aria-current="page">Library</li>
19
+ </ol>
20
+ </nav>
21
+
22
+ <nav aria-label="breadcrumb">
23
+ <ol class="breadcrumb">
24
+ <li class="breadcrumb-item"><a href="#">Home</a></li>
25
+ <li class="breadcrumb-item"><a href="#">Library</a></li>
26
+ <li class="breadcrumb-item active" aria-current="page">Data</li>
27
+ </ol>
28
+ </nav>
29
+ <% end %>
30
+
31
+ <h2>Dividers</h2>
32
+
33
+ <p>Dividers are automatically added in CSS through <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::before"><code>::before</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/content"><code>content</code></a>. They can be changed by modifying a local CSS custom property <code>--bs-breadcrumb-divider</code>, or through the <code>$breadcrumb-divider</code> Sass variable — and <code>$breadcrumb-divider-flipped</code> for its RTL counterpart, if needed. We default to our Sass variable, which is set as a fallback to the custom property. This way, you get a global divider that you can override without recompiling CSS at any time.</p>
34
+
35
+ <%= example_with_code do %>
36
+ <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
37
+ <ol class="breadcrumb">
38
+ <li class="breadcrumb-item"><a href="#">Home</a></li>
39
+ <li class="breadcrumb-item active" aria-current="page">Library</li>
40
+ </ol>
41
+ </nav>
42
+ <% end %>
@@ -0,0 +1,67 @@
1
+ <h1 id="content">Button group</h1>
2
+ <p class="bd-lead">Group a series of buttons together on a single line or stack them in a vertical column.</p>
3
+
4
+ <h2>Basic example</h2>
5
+ <p>Wrap a series of buttons with <code>.btn</code> in <code>.btn-group</code>.</p>
6
+
7
+ <%= example_with_code do %>
8
+ <div class="btn-group" role="group" aria-label="Basic example">
9
+ <button type="button" class="btn btn-primary">Left</button>
10
+ <button type="button" class="btn btn-primary">Middle</button>
11
+ <button type="button" class="btn btn-primary">Right</button>
12
+ </div>
13
+ <% end %>
14
+
15
+ <h2>Checkbox and radio button groups</h2>
16
+
17
+ <p>Combine button-like checkbox and radio toggle buttons into a seamless looking button group.</p>
18
+
19
+ <%= example_with_code do %>
20
+ <div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
21
+ <input type="checkbox" class="btn-check" id="btncheck1" autocomplete="off">
22
+ <label class="btn btn-outline-primary" for="btncheck1">Checkbox 1</label>
23
+
24
+ <input type="checkbox" class="btn-check" id="btncheck2" autocomplete="off">
25
+ <label class="btn btn-outline-primary" for="btncheck2">Checkbox 2</label>
26
+
27
+ <input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
28
+ <label class="btn btn-outline-primary" for="btncheck3">Checkbox 3</label>
29
+ </div>
30
+ <% end %>
31
+
32
+ <% example_with_code do %>
33
+ <div class="btn-group" role="group" aria-label="Basic radio toggle button group">
34
+ <input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off" checked>
35
+ <label class="btn btn-outline-primary" for="btnradio1">Radio 1</label>
36
+
37
+ <input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
38
+ <label class="btn btn-outline-primary" for="btnradio2">Radio 2</label>
39
+
40
+ <input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
41
+ <label class="btn btn-outline-primary" for="btnradio3">Radio 3</label>
42
+ </div>
43
+ <% end %>
44
+
45
+ <h2>Sizing</h2>
46
+
47
+ <p>Instead of applying button sizing classes to every button in a group, just add <code>.btn-group-*</code> to each <code>.btn-group</code>, including each one when nesting multiple groups.</p>
48
+
49
+ <%= example_with_code do %>
50
+ <div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
51
+ <button type="button" class="btn btn-outline-dark">Left</button>
52
+ <button type="button" class="btn btn-outline-dark">Middle</button>
53
+ <button type="button" class="btn btn-outline-dark">Right</button>
54
+ </div>
55
+ <br>
56
+ <div class="btn-group mt-2" role="group" aria-label="Default button group">
57
+ <button type="button" class="btn btn-outline-dark">Left</button>
58
+ <button type="button" class="btn btn-outline-dark">Middle</button>
59
+ <button type="button" class="btn btn-outline-dark">Right</button>
60
+ </div>
61
+ <br>
62
+ <div class="btn-group btn-group-sm mt-2" role="group" aria-label="Small button group">
63
+ <button type="button" class="btn btn-outline-dark">Left</button>
64
+ <button type="button" class="btn btn-outline-dark">Middle</button>
65
+ <button type="button" class="btn btn-outline-dark">Right</button>
66
+ </div>
67
+ <% end %>
@@ -0,0 +1,43 @@
1
+ <h1 class="bd-title" id="content">Buttons</h1>
2
+
3
+ <p>Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.</p>
4
+
5
+ <h2>Examples</h2>
6
+ <p>Bootstrap includes several predefined button styles, each serving its own semantic purpose, with a few extras thrown in for more control.</p>
7
+
8
+ <%= example_with_code do %>
9
+ <button type="button" class="btn btn-primary">Primary</button>
10
+ <button type="button" class="btn btn-secondary">Secondary</button>
11
+ <button type="button" class="btn btn-success">Success</button>
12
+ <button type="button" class="btn btn-danger">Danger</button>
13
+ <button type="button" class="btn btn-warning">Warning</button>
14
+ <button type="button" class="btn btn-info">Info</button>
15
+ <button type="button" class="btn btn-light">Light</button>
16
+ <button type="button" class="btn btn-dark">Dark</button>
17
+
18
+ <button type="button" class="btn btn-link">Link</button>
19
+ <% end %>
20
+
21
+ <h2>Outline buttons</h2>
22
+ <p>In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the <code>.btn-outline-*</code> ones to remove all background images and colors on any button.</p>
23
+
24
+ <%= example_with_code do %>
25
+ <button type="button" class="btn btn-outline-primary">Primary</button>
26
+ <button type="button" class="btn btn-outline-secondary">Secondary</button>
27
+ <button type="button" class="btn btn-outline-success">Success</button>
28
+ <button type="button" class="btn btn-outline-danger">Danger</button>
29
+ <button type="button" class="btn btn-outline-warning">Warning</button>
30
+ <button type="button" class="btn btn-outline-info">Info</button>
31
+ <button type="button" class="btn btn-outline-light">Light</button>
32
+ <button type="button" class="btn btn-outline-dark">Dark</button>
33
+ <% end %>
34
+
35
+ <h2>Sizes</h2>
36
+
37
+ <p>Fancy larger or smaller buttons? Add <code>.btn-lg</code> or <code>.btn-sm</code> for additional sizes.</p>
38
+
39
+ <%= example_with_code do %>
40
+ <button type="button" class="btn btn-primary btn-lg">Large button</button>
41
+ <button type="button" class="btn btn-secondary">Default button</button>
42
+ <button type="button" class="btn btn-secondary btn-sm">Small button</button>
43
+ <% end %>
@@ -0,0 +1,72 @@
1
+ <h1 class="bd-title" id="content">Cards</h1>
2
+
3
+ <p>Bootstrap’s cards provide a flexible and extensible content container with multiple variants and options.</p>
4
+
5
+ <h2>Example</h2>
6
+
7
+ <p>Cards are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components. They have no margin by default, so use spacing utilities as needed.</p>
8
+
9
+ <p>Below is an example of a basic card with mixed content and a fixed width. Cards have no fixed width to start, so they’ll naturally fill the full width of its parent element. This is easily customized with our various sizing options.</p>
10
+
11
+ <%= example_with_code do %>
12
+ <div class="card" style="width: 18rem;">
13
+ <img src="..." class="card-img-top" alt="...">
14
+ <div class="card-body">
15
+ <h5 class="card-title">Card title</h5>
16
+ <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
17
+ <a href="#" class="btn btn-primary">Go somewhere</a>
18
+ </div>
19
+ </div>
20
+ <% end %>
21
+
22
+ <%= example_with_code do %>
23
+ <div class="card" style="width: 18rem;">
24
+ <img src="..." class="card-img-top" alt="...">
25
+ <div class="card-body">
26
+ <h5 class="card-title">Card title</h5>
27
+ <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
28
+ </div>
29
+ <ul class="list-group list-group-flush">
30
+ <li class="list-group-item">An item</li>
31
+ <li class="list-group-item">A second item</li>
32
+ <li class="list-group-item">A third item</li>
33
+ </ul>
34
+ <div class="card-body">
35
+ <a href="#" class="card-link">Card link</a>
36
+ <a href="#" class="card-link">Another link</a>
37
+ </div>
38
+ </div>
39
+ <% end %>
40
+
41
+ <h2>Header and footer</h2>
42
+
43
+ <p>Add an optional header and/or footer within a card.</p>
44
+
45
+ <%= example_with_code do %>
46
+ <div class="card">
47
+ <div class="card-header">
48
+ Featured
49
+ </div>
50
+ <div class="card-body">
51
+ <h5 class="card-title">Special title treatment</h5>
52
+ <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
53
+ <a href="#" class="btn btn-primary">Go somewhere</a>
54
+ </div>
55
+ </div>
56
+ <% end %>
57
+
58
+ <%= example_with_code do %>
59
+ <div class="card text-center">
60
+ <div class="card-header">
61
+ Featured
62
+ </div>
63
+ <div class="card-body">
64
+ <h5 class="card-title">Special title treatment</h5>
65
+ <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
66
+ <a href="#" class="btn btn-primary">Go somewhere</a>
67
+ </div>
68
+ <div class="card-footer text-muted">
69
+ 2 days ago
70
+ </div>
71
+ </div>
72
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <h1 class="bd-title" id="content">Carousel</h1>
2
+
3
+ <p>A slideshow component for cycling through elements—images or slides of text—like a carousel.</p>
4
+
5
+ <h2>Example</h2>
@@ -0,0 +1,10 @@
1
+ <h1 id="content">Close button</h1>
2
+ <p class="bd-lead">A generic close button for dismissing content like modals and alerts.</p>
3
+
4
+ <h2>Example</h2>
5
+
6
+ <p>Provide an option to dismiss or close a component with <code>.btn-close</code>. Default styling is limited, but highly customizable. Modify the Sass variables to replace the default <code>background-image</code>. <strong>Be sure to include text for screen readers</strong>, as we’ve done with <code>aria-label</code>.</p>
7
+
8
+ <%= example_with_code do %>
9
+ <button type="button" class="btn-close" aria-label="Close"></button>
10
+ <% end %>
@@ -0,0 +1,59 @@
1
+
2
+ <h1 id="content">Collapse</h1>
3
+ <p class="bd-lead">Toggle the visibility of content across your project with a few classes and our JavaScript plugins.</p>
4
+
5
+ <h2>Example</h2>
6
+
7
+ <p>Click the buttons below to show and hide another element via class changes:</p>
8
+
9
+ <ul>
10
+ <li><code>.collapse</code> hides content</li>
11
+ <li><code>.collapsing</code> is applied during transitions</li>
12
+ <li><code>.collapse.show</code> shows content</li>
13
+ </ul>
14
+
15
+ <p>Generally, we recommend using a button with the <code>data-bs-target</code> attribute. While not recommended from a semantic point of view, you can also use a link with the <code>href</code> attribute (and a <code>role="button"</code>). In both cases, the <code>data-bs-toggle="collapse"</code> is required.</p>
16
+
17
+ <%= example_with_code do %>
18
+ <p>
19
+ <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
20
+ Link with href
21
+ </a>
22
+ <button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
23
+ Button with data-bs-target
24
+ </button>
25
+ </p>
26
+ <div class="collapse" id="collapseExample">
27
+ <div class="card card-body">
28
+ Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.
29
+ </div>
30
+ </div>
31
+ <% end %>
32
+
33
+ <h2>Multiple targets</h2>
34
+
35
+ <p>A <code>&lt;button&gt;</code> or <code>&lt;a&gt;</code> can show and hide multiple elements by referencing them with a selector in its <code>href</code> or <code>data-bs-target</code> attribute. Multiple <code>&lt;button&gt;</code> or <code>&lt;a&gt;</code> can show and hide an element if they each reference it with their <code>href</code> or <code>data-bs-target</code> attribute</p>
36
+
37
+ <%= example_with_code do %>
38
+ <p>
39
+ <a class="btn btn-primary" data-bs-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Toggle first element</a>
40
+ <button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#multiCollapseExample2" aria-expanded="false" aria-controls="multiCollapseExample2">Toggle second element</button>
41
+ <button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target=".multi-collapse" aria-expanded="false" aria-controls="multiCollapseExample1 multiCollapseExample2">Toggle both elements</button>
42
+ </p>
43
+ <div class="row">
44
+ <div class="col">
45
+ <div class="collapse multi-collapse" id="multiCollapseExample1">
46
+ <div class="card card-body">
47
+ Some placeholder content for the first collapse component of this multi-collapse example. This panel is hidden by default but revealed when the user activates the relevant trigger.
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="col">
52
+ <div class="collapse multi-collapse" id="multiCollapseExample2">
53
+ <div class="card card-body">
54
+ Some placeholder content for the second collapse component of this multi-collapse example. This panel is hidden by default but revealed when the user activates the relevant trigger.
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <% end %>