Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Déramond <julien.deramond@orange.com>2022-07-04 16:49:43 +0300
committerGitHub <noreply@github.com>2022-07-04 16:49:43 +0300
commit888559683fb3cbbfc98e906843103010871e49b7 (patch)
treee8e804fdadcb138e9dcef69aa5c4a68b5e287846 /site/content/docs
parent133d3d1a3119b6400aedc783e002a1d4cac31ba7 (diff)
parentc1813ef2bc2a398e5a9bcdd398608f8a021574e3 (diff)
Merge branch 'main' into main-jd-alphabetical-reorder-of-bs-tablesmain-jd-alphabetical-reorder-of-bs-tables
Diffstat (limited to 'site/content/docs')
-rw-r--r--site/content/docs/5.2/components/alerts.md2
-rw-r--r--site/content/docs/5.2/components/breadcrumb.md2
-rw-r--r--site/content/docs/5.2/components/button-group.md170
-rw-r--r--site/content/docs/5.2/components/carousel.md6
-rw-r--r--site/content/docs/5.2/components/collapse.md2
-rw-r--r--site/content/docs/5.2/components/dropdowns.md62
-rw-r--r--site/content/docs/5.2/components/list-group.md67
-rw-r--r--site/content/docs/5.2/components/modal.md4
-rw-r--r--site/content/docs/5.2/components/navbar.md64
-rw-r--r--site/content/docs/5.2/components/navs-tabs.md6
-rw-r--r--site/content/docs/5.2/components/offcanvas.md22
-rw-r--r--site/content/docs/5.2/components/popovers.md22
-rw-r--r--site/content/docs/5.2/components/toasts.md2
-rw-r--r--site/content/docs/5.2/components/tooltips.md38
-rw-r--r--site/content/docs/5.2/content/reboot.md4
-rw-r--r--site/content/docs/5.2/customize/optimize.md4
-rw-r--r--site/content/docs/5.2/customize/sass.md4
-rw-r--r--site/content/docs/5.2/examples/cheatsheet-rtl/index.html36
-rw-r--r--site/content/docs/5.2/examples/cheatsheet/index.html36
-rw-r--r--site/content/docs/5.2/examples/dashboard-rtl/index.html2
-rw-r--r--site/content/docs/5.2/examples/dashboard/dashboard.css3
-rw-r--r--site/content/docs/5.2/examples/dashboard/dashboard.rtl.css3
-rw-r--r--site/content/docs/5.2/examples/dashboard/index.html2
-rw-r--r--site/content/docs/5.2/examples/headers/index.html12
-rw-r--r--site/content/docs/5.2/examples/navbar-bottom/index.html4
-rw-r--r--site/content/docs/5.2/examples/navbars-offcanvas/index.html12
-rw-r--r--site/content/docs/5.2/examples/navbars/index.html44
-rw-r--r--site/content/docs/5.2/examples/offcanvas-navbar/index.html4
-rw-r--r--site/content/docs/5.2/examples/sidebars/index.html12
-rw-r--r--site/content/docs/5.2/examples/starter-template/index.html1
-rw-r--r--site/content/docs/5.2/forms/checks-radios.md2
-rw-r--r--site/content/docs/5.2/forms/form-control.md6
-rw-r--r--site/content/docs/5.2/getting-started/javascript.md155
-rw-r--r--site/content/docs/5.2/getting-started/vite.md197
-rw-r--r--site/content/docs/5.2/getting-started/webpack.md4
-rw-r--r--site/content/docs/5.2/layout/grid.md144
-rw-r--r--site/content/docs/5.2/migration.md1
-rw-r--r--site/content/docs/5.2/utilities/api.md66
38 files changed, 791 insertions, 436 deletions
diff --git a/site/content/docs/5.2/components/alerts.md b/site/content/docs/5.2/components/alerts.md
index 12cad35881..8837ed46cd 100644
--- a/site/content/docs/5.2/components/alerts.md
+++ b/site/content/docs/5.2/components/alerts.md
@@ -27,7 +27,7 @@ Alerts are available for any length of text, as well as an optional close button
Click the button below to show an alert (hidden with inline styles to start), then dismiss (and destroy) it with the built-in close button.
-{{< example >}}
+{{< example stackblitz_add_js="true" >}}
<div id="liveAlertPlaceholder"></div>
<button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button>
{{< /example >}}
diff --git a/site/content/docs/5.2/components/breadcrumb.md b/site/content/docs/5.2/components/breadcrumb.md
index 05df37a0aa..0012f97481 100644
--- a/site/content/docs/5.2/components/breadcrumb.md
+++ b/site/content/docs/5.2/components/breadcrumb.md
@@ -94,7 +94,7 @@ $breadcrumb-divider: none;
Since breadcrumbs provide a navigation, it's a good idea to add a meaningful label such as `aria-label="breadcrumb"` to describe the type of navigation provided in the `<nav>` element, as well as applying an `aria-current="page"` to the last item of the set to indicate that it represents the current page.
-For more information, see the [WAI-ARIA Authoring Practices for the breadcrumb pattern](https://www.w3.org/TR/wai-aria-practices/#breadcrumb).
+For more information, see the [ARIA Authoring Practices Guide breadcrumb pattern](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/).
## CSS
diff --git a/site/content/docs/5.2/components/button-group.md b/site/content/docs/5.2/components/button-group.md
index 184ca4973a..8f7d2d6a9e 100644
--- a/site/content/docs/5.2/components/button-group.md
+++ b/site/content/docs/5.2/components/button-group.md
@@ -143,31 +143,25 @@ Feel free to mix input groups with button groups in your toolbars. Similar to th
Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to each `.btn-group`, including each one when nesting multiple groups.
-<div class="bd-example">
- <div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
- </div>
- <br>
- <div class="btn-group" role="group" aria-label="Default button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
- </div>
- <br>
- <div class="btn-group btn-group-sm" role="group" aria-label="Small button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
- </div>
+{{< example >}}
+<div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
+ <button type="button" class="btn btn-outline-dark">Left</button>
+ <button type="button" class="btn btn-outline-dark">Middle</button>
+ <button type="button" class="btn btn-outline-dark">Right</button>
</div>
-
-```html
-<div class="btn-group btn-group-lg" role="group" aria-label="...">...</div>
-<div class="btn-group" role="group" aria-label="...">...</div>
-<div class="btn-group btn-group-sm" role="group" aria-label="...">...</div>
-```
+<br>
+<div class="btn-group" role="group" aria-label="Default button group">
+ <button type="button" class="btn btn-outline-dark">Left</button>
+ <button type="button" class="btn btn-outline-dark">Middle</button>
+ <button type="button" class="btn btn-outline-dark">Right</button>
+</div>
+<br>
+<div class="btn-group btn-group-sm" role="group" aria-label="Small button group">
+ <button type="button" class="btn btn-outline-dark">Left</button>
+ <button type="button" class="btn btn-outline-dark">Middle</button>
+ <button type="button" class="btn btn-outline-dark">Right</button>
+</div>
+{{< /example >}}
## Nesting
@@ -179,10 +173,10 @@ Place a `.btn-group` within another `.btn-group` when you want dropdown menus mi
<button type="button" class="btn btn-primary">2</button>
<div class="btn-group" role="group">
- <button id="btnGroupDrop1" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
- <ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
</ul>
@@ -194,75 +188,69 @@ Place a `.btn-group` within another `.btn-group` when you want dropdown menus mi
Make a set of buttons appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.**
-<div class="bd-example">
- <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- </div>
+{{< example >}}
+<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
+ <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-dark">Button</button>
</div>
+{{< /example >}}
-<div class="bd-example">
- <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
- <button type="button" class="btn btn-primary">Button</button>
- <button type="button" class="btn btn-primary">Button</button>
- <div class="btn-group" role="group">
- <button id="btnGroupVerticalDrop1" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
- Dropdown
- </button>
- <ul class="dropdown-menu" aria-labelledby="btnGroupVerticalDrop1">
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- </ul>
- </div>
- <button type="button" class="btn btn-primary">Button</button>
- <button type="button" class="btn btn-primary">Button</button>
- <div class="btn-group" role="group">
- <button id="btnGroupVerticalDrop2" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
- Dropdown
- </button>
- <ul class="dropdown-menu" aria-labelledby="btnGroupVerticalDrop2">
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- </ul>
- </div>
- <div class="btn-group" role="group">
- <button id="btnGroupVerticalDrop3" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
- Dropdown
- </button>
- <ul class="dropdown-menu" aria-labelledby="btnGroupVerticalDrop3">
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- </ul>
- </div>
- <div class="btn-group" role="group">
- <button id="btnGroupVerticalDrop4" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
- Dropdown
- </button>
- <ul class="dropdown-menu" aria-labelledby="btnGroupVerticalDrop4">
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- <li><a class="dropdown-item" href="#">Dropdown link</a></li>
- </ul>
- </div>
+{{< example >}}
+<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <div class="btn-group" role="group">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ Dropdown
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ </ul>
</div>
-</div>
-
-<div class="bd-example">
- <div class="btn-group-vertical" role="group" aria-label="Vertical radio toggle button group">
- <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio1" autocomplete="off" checked>
- <label class="btn btn-outline-danger" for="vbtn-radio1">Radio 1</label>
- <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio2" autocomplete="off">
- <label class="btn btn-outline-danger" for="vbtn-radio2">Radio 2</label>
- <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio3" autocomplete="off">
- <label class="btn btn-outline-danger" for="vbtn-radio3">Radio 3</label>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <div class="btn-group" role="group">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ Dropdown
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ </ul>
+ </div>
+ <div class="btn-group" role="group">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ Dropdown
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ </ul>
+ </div>
+ <div class="btn-group" role="group">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ Dropdown
+ </button>
+ <ul class="dropdown-menu">
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ <li><a class="dropdown-item" href="#">Dropdown link</a></li>
+ </ul>
</div>
</div>
+{{< /example >}}
-```html
-<div class="btn-group-vertical">
- ...
+{{< example >}}
+<div class="btn-group-vertical" role="group" aria-label="Vertical radio toggle button group">
+ <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio1" autocomplete="off" checked>
+ <label class="btn btn-outline-danger" for="vbtn-radio1">Radio 1</label>
+ <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio2" autocomplete="off">
+ <label class="btn btn-outline-danger" for="vbtn-radio2">Radio 2</label>
+ <input type="radio" class="btn-check" name="vbtn-radio" id="vbtn-radio3" autocomplete="off">
+ <label class="btn btn-outline-danger" for="vbtn-radio3">Radio 3</label>
</div>
-```
+{{< /example >}}
diff --git a/site/content/docs/5.2/components/carousel.md b/site/content/docs/5.2/components/carousel.md
index b2894ab129..fee28995bc 100644
--- a/site/content/docs/5.2/components/carousel.md
+++ b/site/content/docs/5.2/components/carousel.md
@@ -208,10 +208,10 @@ Add `data-bs-interval=""` to a `.carousel-item` to change the amount of time to
### Disable touch swiping
-Carousels support swiping left/right on touchscreen devices to move between slides. This can be disabled using the `data-bs-touch` attribute. The example below also does not include the `data-bs-ride` attribute and has `data-bs-interval="false"` so it doesn't autoplay.
+Carousels support swiping left/right on touchscreen devices to move between slides. This can be disabled using the `data-bs-touch` attribute. The example below also does not include the `data-bs-ride` attribute so it doesn't autoplay.
{{< example >}}
-<div id="carouselExampleControlsNoTouching" class="carousel slide" data-bs-touch="false" data-bs-interval="false">
+<div id="carouselExampleControlsNoTouching" class="carousel slide" data-bs-touch="false">
<div class="carousel-inner">
<div class="carousel-item active">
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
@@ -314,7 +314,7 @@ const carousel = new bootstrap.Carousel('#myCarousel')
{{< bs-table >}}
| Name | Type | Default | Description |
| --- | --- | --- | --- |
-| `interval` | number | `5000` | The amount of time to delay between automatically cycling an item. If `false`, carousel will not automatically cycle. |
+| `interval` | number | `5000` | The amount of time to delay between automatically cycling an item. |
| `keyboard` | boolean | `true` | Whether the carousel should react to keyboard events. |
| `pause` | string, boolean | `"hover"` | If set to `"hover"`, pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`. If set to `false`, hovering over the carousel won't pause it. On touch-enabled devices, when set to `"hover"`, cycling will pause on `touchend` (once the user finished interacting with the carousel) for two intervals, before automatically resuming. This is in addition to the mouse behavior. |
| `ride` | string, boolean | `false` | If set to `true`, autoplays the carousel after the user manually cycles the first item. If set to `"carousel"`, autoplays the carousel on load. |
diff --git a/site/content/docs/5.2/components/collapse.md b/site/content/docs/5.2/components/collapse.md
index 3c89327c2d..cc7c429ad2 100644
--- a/site/content/docs/5.2/components/collapse.md
+++ b/site/content/docs/5.2/components/collapse.md
@@ -98,7 +98,7 @@ Be sure to add `aria-expanded` to the control element. This attribute explicitly
If your control element is targeting a single collapsible element – i.e. the `data-bs-target` attribute is pointing to an `id` selector – you should add the `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.
-Note that Bootstrap's current implementation does not cover the various *optional* keyboard interactions described in the [WAI-ARIA Authoring Practices 1.1 accordion pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#accordion) - you will need to include these yourself with custom JavaScript.
+Note that Bootstrap's current implementation does not cover the various *optional* keyboard interactions described in the [ARIA Authoring Practices Guide accordion pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/) - you will need to include these yourself with custom JavaScript.
## Sass
diff --git a/site/content/docs/5.2/components/dropdowns.md b/site/content/docs/5.2/components/dropdowns.md
index d3edd2efb5..f7746e372a 100644
--- a/site/content/docs/5.2/components/dropdowns.md
+++ b/site/content/docs/5.2/components/dropdowns.md
@@ -14,7 +14,7 @@ Dropdowns are built on a third party library, [Popper](https://popper.js.org/),
## Accessibility
-The [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr>](https://www.w3.org/TR/wai-aria/) standard defines an actual [`role="menu"` widget](https://www.w3.org/WAI/PF/aria/roles#menu), but this is specific to application-like menus which trigger actions or functions. <abbr title="Accessible Rich Internet Applications">ARIA</abbr> menus can only contain menu items, checkbox menu items, radio button menu items, radio button groups, and sub-menus.
+The [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr>](https://www.w3.org/TR/wai-aria/) standard defines an actual [`role="menu"` widget](https://www.w3.org/TR/wai-aria/#menu), but this is specific to application-like menus which trigger actions or functions. <abbr title="Accessible Rich Internet Applications">ARIA</abbr> menus can only contain menu items, checkbox menu items, radio button menu items, radio button groups, and sub-menus.
Bootstrap's dropdowns, on the other hand, are designed to be generic and applicable to a variety of situations and markup structures. For instance, it is possible to create dropdowns that contain additional inputs and form controls, such as search fields or login forms. For this reason, Bootstrap does not expect (nor automatically add) any of the `role` and `aria-` attributes required for true <abbr title="Accessible Rich Internet Applications">ARIA</abbr> menus. Authors will have to include these more specific attributes themselves.
@@ -30,10 +30,10 @@ Any single `.btn` can be turned into a dropdown toggle with some markup changes.
{{< example >}}
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -45,11 +45,11 @@ And with `<a>` elements:
{{< example >}}
<div class="dropdown">
- <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="btn btn-secondary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown link
</a>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -353,10 +353,10 @@ Opt into darker dropdowns to match a dark navbar or custom style by adding `.dro
{{< example >}}
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
- <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="dropdownMenuButton2">
+ <ul class="dropdown-menu dropdown-menu-dark">
<li><a class="dropdown-item active" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -378,10 +378,10 @@ And putting it to use in a navbar:
<div class="collapse navbar-collapse" id="navbarNavDarkDropdown">
<ul class="navbar-nav">
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDarkDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
+ <ul class="dropdown-menu dropdown-menu-dark">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -406,10 +406,10 @@ Make the dropdown menu centered below the toggle with `.dropdown-center` on the
{{< example >}}
<div class="dropdown-center">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownCenterBtn" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Centered dropdown
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownCenterBtn">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Action two</a></li>
<li><a class="dropdown-item" href="#">Action three</a></li>
@@ -482,10 +482,10 @@ Make the dropup menu centered above the toggle with `.dropup-center` on the pare
{{< example >}}
<div class="dropup-center dropup">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropupCenterBtn" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Centered dropup
</button>
- <ul class="dropdown-menu" aria-labelledby="dropupCenterBtn">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Action two</a></li>
<li><a class="dropdown-item" href="#">Action three</a></li>
@@ -617,10 +617,10 @@ You can use `<a>` or `<button>` elements as dropdown items.
{{< example >}}
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
+ <ul class="dropdown-menu">
<li><button class="dropdown-item" type="button">Action</button></li>
<li><button class="dropdown-item" type="button">Another action</button></li>
<li><button class="dropdown-item" type="button">Something else here</button></li>
@@ -728,10 +728,10 @@ Taking most of the options shown above, here's a small kitchen sink demo of vari
{{< example >}}
<div class="btn-group">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
@@ -913,10 +913,10 @@ Use `data-bs-offset` or `data-bs-reference` to change the location of the dropdo
{{< example >}}
<div class="d-flex">
<div class="dropdown me-1">
- <button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuOffset" data-bs-toggle="dropdown" aria-expanded="false" data-bs-offset="10,20">
+ <button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" data-bs-offset="10,20">
Offset
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuOffset">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -924,10 +924,10 @@ Use `data-bs-offset` or `data-bs-reference` to change the location of the dropdo
</div>
<div class="btn-group">
<button type="button" class="btn btn-secondary">Reference</button>
- <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" id="dropdownMenuReference" data-bs-toggle="dropdown" aria-expanded="false" data-bs-reference="parent">
+ <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false" data-bs-reference="parent">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuReference">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -944,10 +944,10 @@ By default, the dropdown menu is closed when clicking inside or outside the drop
{{< example >}}
<div class="btn-group">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="defaultDropdown" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-expanded="false">
Default dropdown
</button>
- <ul class="dropdown-menu" aria-labelledby="defaultDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
@@ -955,10 +955,10 @@ By default, the dropdown menu is closed when clicking inside or outside the drop
</div>
<div class="btn-group">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuClickableOutside" data-bs-toggle="dropdown" data-bs-auto-close="inside" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="inside" aria-expanded="false">
Clickable outside
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuClickableOutside">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
@@ -966,10 +966,10 @@ By default, the dropdown menu is closed when clicking inside or outside the drop
</div>
<div class="btn-group">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuClickableInside" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
Clickable inside
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuClickableInside">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
@@ -977,10 +977,10 @@ By default, the dropdown menu is closed when clicking inside or outside the drop
</div>
<div class="btn-group">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuClickable" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false">
Manual close
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuClickable">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
<li><a class="dropdown-item" href="#">Menu item</a></li>
@@ -1036,10 +1036,10 @@ Add `data-bs-toggle="dropdown"` to a link or button to toggle a dropdown.
```html
<div class="dropdown">
- <button id="dLabel" type="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <button type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown trigger
</button>
- <ul class="dropdown-menu" aria-labelledby="dLabel">
+ <ul class="dropdown-menu">
...
</ul>
</div>
diff --git a/site/content/docs/5.2/components/list-group.md b/site/content/docs/5.2/components/list-group.md
index 349823a589..d9b2ea200f 100644
--- a/site/content/docs/5.2/components/list-group.md
+++ b/site/content/docs/5.2/components/list-group.md
@@ -247,53 +247,54 @@ Place Bootstrap's checkboxes and radios within list group items and customize as
{{< example >}}
<ul class="list-group">
<li class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="" aria-label="...">
- First checkbox
+ <input class="form-check-input me-1" type="checkbox" value="" id="firstCheckbox">
+ <label class="form-check-label" for="firstCheckbox">First checkbox</label>
</li>
<li class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="" aria-label="...">
- Second checkbox
+ <input class="form-check-input me-1" type="checkbox" value="" id="secondCheckbox">
+ <label class="form-check-label" for="secondCheckbox">Second checkbox</label>
</li>
<li class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="" aria-label="...">
- Third checkbox
+ <input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckbox">
+ <label class="form-check-label" for="thirdCheckbox">Third checkbox</label>
</li>
+</ul>
+{{< /example >}}
+
+{{< example >}}
+<ul class="list-group">
<li class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="" aria-label="...">
- Fourth checkbox
+ <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="firstRadio" checked>
+ <label class="form-check-label" for="firstRadio">First radio</label>
</li>
<li class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="" aria-label="...">
- Fifth checkbox
+ <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="secondRadio">
+ <label class="form-check-label" for="secondRadio">Second radio</label>
+ </li>
+ <li class="list-group-item">
+ <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="thirdRadio">
+ <label class="form-check-label" for="thirdRadio">Third radio</label>
</li>
</ul>
{{< /example >}}
-And if you want `<label>`s as the `.list-group-item` for large hit areas, you can do that, too.
+You can use `.stretched-link` on `<label>`s to make the whole list group item clickable.
{{< example >}}
-<div class="list-group">
- <label class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="">
- First checkbox
- </label>
- <label class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="">
- Second checkbox
- </label>
- <label class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="">
- Third checkbox
- </label>
- <label class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="">
- Fourth checkbox
- </label>
- <label class="list-group-item">
- <input class="form-check-input me-1" type="checkbox" value="">
- Fifth checkbox
- </label>
-</div>
+<ul class="list-group">
+ <li class="list-group-item">
+ <input class="form-check-input me-1" type="checkbox" value="" id="firstCheckboxStretched">
+ <label class="form-check-label stretched-link" for="firstCheckboxStretched">First checkbox</label>
+ </li>
+ <li class="list-group-item">
+ <input class="form-check-input me-1" type="checkbox" value="" id="secondCheckboxStretched">
+ <label class="form-check-label stretched-link" for="secondCheckboxStretched">Second checkbox</label>
+ </li>
+ <li class="list-group-item">
+ <input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckboxStretched">
+ <label class="form-check-label stretched-link" for="thirdCheckboxStretched">Third checkbox</label>
+ </li>
+</ul>
{{< /example >}}
## CSS
diff --git a/site/content/docs/5.2/components/modal.md b/site/content/docs/5.2/components/modal.md
index 87c0687424..373078e593 100644
--- a/site/content/docs/5.2/components/modal.md
+++ b/site/content/docs/5.2/components/modal.md
@@ -444,7 +444,7 @@ Have a bunch of buttons that all trigger the same modal with slightly different
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
-{{< example >}}
+{{< example stackblitz_add_js="true" >}}
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Open modal for @mdo</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@fat">Open modal for @fat</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@getbootstrap">Open modal for @getbootstrap</button>
@@ -807,7 +807,7 @@ Activate a modal without writing JavaScript. Set `data-bs-toggle="modal"` on a c
{{% js-dismiss "modal" %}}
{{< callout warning >}}
-While both ways to dismiss a modal are supported, keep in mind that dismissing from outside a modal does not match [the WAI-ARIA modal dialog design pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal). Do this at your own risk.
+While both ways to dismiss a modal are supported, keep in mind that dismissing from outside a modal does not match the [ARIA Authoring Practices Guide dialog (modal) pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/). Do this at your own risk.
{{< /callout >}}
### Via JavaScript
diff --git a/site/content/docs/5.2/components/navbar.md b/site/content/docs/5.2/components/navbar.md
index 392531160d..a1d671a427 100644
--- a/site/content/docs/5.2/components/navbar.md
+++ b/site/content/docs/5.2/components/navbar.md
@@ -52,10 +52,10 @@ Here's an example of all the sub-components included in a responsive light-theme
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
@@ -207,10 +207,10 @@ You can also use dropdowns in your navbar. Dropdown menus require a wrapping ele
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown link
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -523,10 +523,10 @@ Here's an example navbar using `.navbar-nav-scroll` with `style="--bs-scroll-hei
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarScrollingDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Link
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
@@ -670,7 +670,7 @@ When you do this, we recommend including additional JavaScript to move the focus
### Offcanvas
-Transform your expanding and collapsing navbar into an offcanvas drawer with the offcanvas plugin. We extend both the offcanvas default styles and use our `.navbar-expand-*` classes to create a dynamic and flexible navigation sidebar.
+Transform your expanding and collapsing navbar into an offcanvas drawer with the [offcanvas component]({{< docsref "/components/offcanvas" >}}). We extend both the offcanvas default styles and use our `.navbar-expand-*` classes to create a dynamic and flexible navigation sidebar.
In the example below, to create an offcanvas navbar that is always collapsed across all breakpoints, omit the `.navbar-expand-*` class entirely.
@@ -695,10 +695,10 @@ In the example below, to create an offcanvas navbar that is always collapsed acr
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="offcanvasNavbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="offcanvasNavbarDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li>
@@ -732,6 +732,52 @@ To create an offcanvas navbar that expands into a normal navbar at a specific br
</nav>
```
+When using offcanvas in a dark navbar, be aware that you may need to have a dark background on the offcanvas content to avoid the text becoming illegible. In the example below, we add `.navbar-dark` and `.bg-dark` to the `.navbar`, `.text-bg-dark` to the `.offcanvas`, `.dropdown-menu-dark` to `.dropdown-menu`, and `.btn-close-white` to `.btn-close` for proper styling with a dark offcanvas.
+
+{{< example >}}
+<nav class="navbar navbar-dark bg-dark fixed-top">
+ <div class="container-fluid">
+ <a class="navbar-brand" href="#">Offcanvas dark navbar</a>
+ <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDarkNavbar" aria-controls="offcanvasDarkNavbar">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="offcanvas offcanvas-end text-bg-dark" tabindex="-1" id="offcanvasDarkNavbar" aria-labelledby="offcanvasDarkNavbarLabel">
+ <div class="offcanvas-header">
+ <h5 class="offcanvas-title" id="offcanvasDarkNavbarLabel">Dark offcanvas</h5>
+ <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas" aria-label="Close"></button>
+ </div>
+ <div class="offcanvas-body">
+ <ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
+ <li class="nav-item">
+ <a class="nav-link active" aria-current="page" href="#">Home</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="#">Link</a>
+ </li>
+ <li class="nav-item dropdown">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ Dropdown
+ </a>
+ <ul class="dropdown-menu dropdown-menu-dark">
+ <li><a class="dropdown-item" href="#">Action</a></li>
+ <li><a class="dropdown-item" href="#">Another action</a></li>
+ <li>
+ <hr class="dropdown-divider">
+ </li>
+ <li><a class="dropdown-item" href="#">Something else here</a></li>
+ </ul>
+ </li>
+ </ul>
+ <form class="d-flex" role="search">
+ <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
+ <button class="btn btn-success" type="submit">Search</button>
+ </form>
+ </div>
+ </div>
+ </div>
+</nav>
+{{< /example >}}
+
## CSS
### Variables
diff --git a/site/content/docs/5.2/components/navs-tabs.md b/site/content/docs/5.2/components/navs-tabs.md
index 978a702c42..0c6aa422a6 100644
--- a/site/content/docs/5.2/components/navs-tabs.md
+++ b/site/content/docs/5.2/components/navs-tabs.md
@@ -246,7 +246,7 @@ If you need responsive nav variations, consider using a series of [flexbox utili
If you're using navs to provide a navigation bar, be sure to add a `role="navigation"` to the most logical parent container of the `<ul>`, or wrap a `<nav>` element around the whole navigation. Do not add the role to the `<ul>` itself, as this would prevent it from being announced as an actual list by assistive technologies.
-Note that navigation bars, even if visually styled as tabs with the `.nav-tabs` class, should **not** be given `role="tablist"`, `role="tab"` or `role="tabpanel"` attributes. These are only appropriate for dynamic tabbed interfaces, as described in the [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel). See [JavaScript behavior](#javascript-behavior) for dynamic tabbed interfaces in this section for an example. The `aria-current` attribute is not necessary on dynamic tabbed interfaces since our JavaScript handles the selected state by adding `aria-selected="true"` on the active tab.
+Note that navigation bars, even if visually styled as tabs with the `.nav-tabs` class, should **not** be given `role="tablist"`, `role="tab"` or `role="tabpanel"` attributes. These are only appropriate for dynamic tabbed interfaces, as described in the [ARIA Authoring Practices Guide tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/). See [JavaScript behavior](#javascript-behavior) for dynamic tabbed interfaces in this section for an example. The `aria-current` attribute is not necessary on dynamic tabbed interfaces since our JavaScript handles the selected state by adding `aria-selected="true"` on the active tab.
## Using dropdowns
@@ -538,9 +538,9 @@ And with vertical pills. Ideally, for vertical tabs, you should also add `aria-o
### Accessibility
-Dynamic tabbed interfaces, as described in the [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Authoring Practices 1.2](https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality, and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using `<button>` elements for the tabs, as these are controls that trigger a dynamic change, rather than links that navigate to a new page or location.
+Dynamic tabbed interfaces, as described in the [ARIA Authoring Practices Guide tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality, and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using `<button>` elements for the tabs, as these are controls that trigger a dynamic change, rather than links that navigate to a new page or location.
-In line with the ARIA Authoring Practices pattern, only the currently active tab receives keyboard focus. When the JavaScript plugin is initialized, it will set `tabindex="-1"` on all inactive tab controls. Once the currently active tab has focus, the cursor keys activate the previous/next tab, with the plugin changing the [roving `tabindex`](https://www.w3.org/TR/wai-aria-practices-1.2/#kbd_roving_tabindex) accordingly. However, note that the JavaScript plugin does not distinguish between horizontal and vertical tab lists when it comes to cursor key interactions: regardless of the tab list's orientation, both the up *and* left cursor go to the previous tab, and down *and* right cursor go to the next tab.
+In line with the ARIA Authoring Practices pattern, only the currently active tab receives keyboard focus. When the JavaScript plugin is initialized, it will set `tabindex="-1"` on all inactive tab controls. Once the currently active tab has focus, the cursor keys activate the previous/next tab, with the plugin changing the [roving `tabindex`](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/) accordingly. However, note that the JavaScript plugin does not distinguish between horizontal and vertical tab lists when it comes to cursor key interactions: regardless of the tab list's orientation, both the up *and* left cursor go to the previous tab, and down *and* right cursor go to the next tab.
{{< callout warning >}}
In general, to facilitate keyboard navigation, it's recommended to make the tab panels themselves focusable as well, unless the first element containing meaningful content inside the tab panel is already focusable. The JavaScript plugin does not try to handle this aspect—where appropriate, you'll need to explicitly make your tab panels focusable by adding `tabindex="0"` in your markup.
diff --git a/site/content/docs/5.2/components/offcanvas.md b/site/content/docs/5.2/components/offcanvas.md
index 9b05a03070..d3c59c40f4 100644
--- a/site/content/docs/5.2/components/offcanvas.md
+++ b/site/content/docs/5.2/components/offcanvas.md
@@ -66,10 +66,10 @@ You can use a link with the `href` attribute, or a button with the `data-bs-targ
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.
</div>
<div class="dropdown mt-3">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
Dropdown button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -79,6 +79,22 @@ You can use a link with the `href` attribute, or a button with the `data-bs-targ
</div>
{{< /example >}}
+### Dark offcanvas
+
+Change the appearance of offcanvases with utilities to better match them to different contexts like dark navbars. Here we add `.text-bg-dark` to the `.offcanvas` and `.btn-close-white` to `.btn-close` for proper styling with a dark offcanvas. If you have dropdowns within, consider also adding `.dropdown-menu-dark` to `.dropdown-menu`.
+
+{{< example class="bd-example-offcanvas p-0 bg-light overflow-hidden" >}}
+<div class="offcanvas offcanvas-start show text-bg-dark" tabindex="-1" id="offcanvasDark" aria-labelledby="offcanvasDarkLabel">
+ <div class="offcanvas-header">
+ <h5 class="offcanvas-title" id="offcanvasDarkLabel">Offcanvas</h5>
+ <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvasDark" aria-label="Close"></button>
+ </div>
+ <div class="offcanvas-body">
+ <p>Place offcanvas content here.</p>
+ </div>
+</div>
+{{< /example >}}
+
### Body scrolling
Scrolling the `<body>` element is disabled when an offcanvas and its backdrop are visible. Use the `data-bs-scroll` attribute to enable `<body>` scrolling.
@@ -263,7 +279,7 @@ Add `data-bs-toggle="offcanvas"` and a `data-bs-target` or `href` to the element
{{% js-dismiss "offcanvas" %}}
{{< callout warning >}}
-While both ways to dismiss an offcanvas are supported, keep in mind that dismissing from outside an offcanvas does not match [the WAI-ARIA modal dialog design pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal). Do this at your own risk.
+While both ways to dismiss an offcanvas are supported, keep in mind that dismissing from outside an offcanvas does not match the [ARIA Authoring Practices Guide dialog (modal) pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/). Do this at your own risk.
{{< /callout >}}
### Via JavaScript
diff --git a/site/content/docs/5.2/components/popovers.md b/site/content/docs/5.2/components/popovers.md
index a96e0fb530..b035ece229 100644
--- a/site/content/docs/5.2/components/popovers.md
+++ b/site/content/docs/5.2/components/popovers.md
@@ -44,17 +44,21 @@ const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstra
### Live demo
-We use JavaScript similar to the snippet above to render the following live popover. Titles are set via `title` attribute and body content is set via `data-bs-content`.
+We use JavaScript similar to the snippet above to render the following live popover. Titles are set via `data-bs-title` and body content is set via `data-bs-content`.
-{{< example >}}
-<button type="button" class="btn btn-lg btn-danger" data-bs-toggle="popover" title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
+{{< callout warning >}}
+{{< partial "callout-warning-data-bs-title-vs-title.md" >}}
+{{< /callout >}}
+
+{{< example stackblitz_add_js="true" >}}
+<button type="button" class="btn btn-lg btn-danger" data-bs-toggle="popover" data-bs-title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
{{< /example >}}
### Four directions
Four options are available: top, right, bottom, and left. Directions are mirrored when using Bootstrap in RTL. Set `data-bs-placement` to change the direction.
-{{< example >}}
+{{< example stackblitz_add_js="true" >}}
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" data-bs-content="Top popover">
Popover on top
</button>
@@ -87,11 +91,11 @@ You can customize the appearance of popovers using [CSS variables](#variables).
{{< scss-docs name="custom-popovers" file="site/assets/scss/_component-examples.scss" >}}
-{{< example class="custom-popover-demo" >}}
+{{< example class="custom-popover-demo" stackblitz_add_js="true" >}}
<button type="button" class="btn btn-secondary"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-custom-class="custom-popover"
- title="Custom popover"
+ data-bs-title="Custom popover"
data-bs-content="This popover is themed via CSS variables.">
Custom popover
</button>
@@ -107,8 +111,8 @@ Use the `focus` trigger to dismiss popovers on the user's next click of a differ
For proper cross-browser and cross-platform behavior, you must use the `<a>` tag, _not_ the `<button>` tag, and you also must include a [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) attribute.
{{< /callout >}}
-{{< example >}}
-<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-bs-toggle="popover" data-bs-trigger="focus" title="Dismissible popover" data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
+{{< example stackblitz_add_js="true" >}}
+<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-title="Dismissible popover" data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
{{< /example >}}
```js
@@ -123,7 +127,7 @@ Elements with the `disabled` attribute aren't interactive, meaning users cannot
For disabled popover triggers, you may also prefer `data-bs-trigger="hover focus"` so that the popover appears as immediate visual feedback to your users as they may not expect to _click_ on a disabled element.
-{{< example >}}
+{{< example stackblitz_add_js="true" >}}
<span class="d-inline-block" tabindex="0" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Disabled popover">
<button class="btn btn-primary" type="button" disabled>Disabled button</button>
</span>
diff --git a/site/content/docs/5.2/components/toasts.md b/site/content/docs/5.2/components/toasts.md
index 5591a0bc96..e718d30697 100644
--- a/site/content/docs/5.2/components/toasts.md
+++ b/site/content/docs/5.2/components/toasts.md
@@ -197,7 +197,7 @@ Building on the above example, you can create different toast color schemes with
Place toasts with custom CSS as you need them. The top right is often used for notifications, as is the top middle. If you're only ever going to show one toast at a time, put the positioning styles right on the `.toast`.
-{{< example >}}
+{{< example stackblitz_add_js="true" >}}
<form>
<div class="mb-3">
<label for="selectToastPlacement">Toast placement</label>
diff --git a/site/content/docs/5.2/components/tooltips.md b/site/content/docs/5.2/components/tooltips.md
index e28c368601..e007de641c 100644
--- a/site/content/docs/5.2/components/tooltips.md
+++ b/site/content/docs/5.2/components/tooltips.md
@@ -45,11 +45,15 @@ const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstra
Hover over the links below to see tooltips:
-{{< example class="tooltip-demo" >}}
-<p class="muted">Placeholder text to demonstrate some <a href="#" data-bs-toggle="tooltip" title="Default tooltip">inline links</a> with tooltips. This is now just filler, no killer. Content placed here just to mimic the presence of <a href="#" data-bs-toggle="tooltip" title="Another tooltip">real text</a>. And all that just to give you an idea of how tooltips would look when used in real-world situations. So hopefully you've now seen how <a href="#" data-bs-toggle="tooltip" title="Another one here too">these tooltips on links</a> can work in practice, once you use them on <a href="#" data-bs-toggle="tooltip" title="The last tip!">your own</a> site or project.
+{{< example class="tooltip-demo" stackblitz_add_js="true" >}}
+<p class="muted">Placeholder text to demonstrate some <a href="#" data-bs-toggle="tooltip" data-bs-title="Default tooltip">inline links</a> with tooltips. This is now just filler, no killer. Content placed here just to mimic the presence of <a href="#" data-bs-toggle="tooltip" data-bs-title="Another tooltip">real text</a>. And all that just to give you an idea of how tooltips would look when used in real-world situations. So hopefully you've now seen how <a href="#" data-bs-toggle="tooltip" data-bs-title="Another one here too">these tooltips on links</a> can work in practice, once you use them on <a href="#" data-bs-toggle="tooltip" data-bs-title="The last tip!">your own</a> site or project.
</p>
{{< /example >}}
+{{< callout warning >}}
+{{< partial "callout-warning-data-bs-title-vs-title.md" >}}
+{{< /callout >}}
+
### Custom tooltips
{{< added-in "5.2.0" >}}
@@ -59,11 +63,11 @@ You can customize the appearance of tooltips using [CSS variables](#variables).
{{< scss-docs name="custom-tooltip" file="site/assets/scss/_component-examples.scss" >}}
-{{< example class="tooltip-demo" >}}
+{{< example class="tooltip-demo" stackblitz_add_js="true" >}}
<button type="button" class="btn btn-secondary"
data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-custom-class="custom-tooltip"
- title="This top tooltip is themed via CSS variables.">
+ data-bs-title="This top tooltip is themed via CSS variables.">
Custom tooltip
</button>
{{< /example >}}
@@ -74,25 +78,25 @@ Hover over the buttons below to see the four tooltips directions: top, right, bo
<div class="bd-example tooltip-demo">
<div class="bd-example-tooltips">
- <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">Tooltip on top</button>
- <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="right" title="Tooltip on right">Tooltip on right</button>
- <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>
- <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="left" title="Tooltip on left">Tooltip on left</button>
- <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">Tooltip with HTML</button>
+ <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Tooltip on top">Tooltip on top</button>
+ <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">Tooltip on right</button>
+ <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Tooltip on bottom">Tooltip on bottom</button>
+ <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-title="Tooltip on left">Tooltip on left</button>
+ <button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" data-bs-title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">Tooltip with HTML</button>
</div>
</div>
```html
-<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">
+<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Tooltip on top">
Tooltip on top
</button>
-<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="right" title="Tooltip on right">
+<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
Tooltip on right
</button>
-<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tooltip on bottom">
+<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Tooltip on bottom">
Tooltip on bottom
</button>
-<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="left" title="Tooltip on left">
+<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-title="Tooltip on left">
Tooltip on left
</button>
```
@@ -100,7 +104,7 @@ Hover over the buttons below to see the four tooltips directions: top, right, bo
And with custom HTML added:
```html
-<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
+<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" data-bs-title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
```
@@ -108,7 +112,7 @@ And with custom HTML added:
With an SVG:
<div class="bd-example tooltip-demo">
- <a href="#" class="d-inline-block" data-bs-toggle="tooltip" title="Default tooltip">
+ <a href="#" class="d-inline-block" data-bs-toggle="tooltip" data-bs-title="Default tooltip">
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 100 100">
<rect width="100%" height="100%" fill="#563d7c"/>
<circle cx="50" cy="50" r="30" fill="#007bff"/>
@@ -165,7 +169,7 @@ You should only add tooltips to HTML elements that are traditionally keyboard-fo
```html
<!-- HTML to write -->
-<a href="#" data-bs-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
+<a href="#" data-bs-toggle="tooltip" data-bs-title="Some tooltip text!">Hover over me</a>
<!-- Generated markup by the plugin -->
<div class="tooltip bs-tooltip-top" role="tooltip">
@@ -182,7 +186,7 @@ Elements with the `disabled` attribute aren't interactive, meaning users cannot
<div class="tooltip-demo">
{{< example >}}
-<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" title="Disabled tooltip">
+<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-title="Disabled tooltip">
<button class="btn btn-primary" type="button" disabled>Disabled button</button>
</span>
{{< /example >}}
diff --git a/site/content/docs/5.2/content/reboot.md b/site/content/docs/5.2/content/reboot.md
index 4a1521cd00..911155af25 100644
--- a/site/content/docs/5.2/content/reboot.md
+++ b/site/content/docs/5.2/content/reboot.md
@@ -106,8 +106,8 @@ The `<hr>` element has been simplified. Similar to browser defaults, `<hr>`s are
<hr>
</div>
-<hr class="text-danger border-2 opacity-50">
-<hr class="border-primary border-3 opacity-75">
+<hr class="border border-danger border-2 opacity-50">
+<hr class="border border-primary border-3 opacity-75">
{{< /example >}}
## Lists
diff --git a/site/content/docs/5.2/customize/optimize.md b/site/content/docs/5.2/customize/optimize.md
index b5e8de7ee2..e618ce23a0 100644
--- a/site/content/docs/5.2/customize/optimize.md
+++ b/site/content/docs/5.2/customize/optimize.md
@@ -19,7 +19,7 @@ If you're not using a component, comment it out or delete it entirely. For examp
Bootstrap's JavaScript includes every component in our primary dist files (`bootstrap.js` and `bootstrap.min.js`), and even our primary dependency (Popper) with our bundle files (`bootstrap.bundle.js` and `bootstrap.bundle.min.js`). While you're customizing via Sass, be sure to remove related JavaScript.
-For instance, assuming you're using your own JavaScript bundler like Webpack or Rollup, you'd only import the JavaScript you plan on using. In the example below, we show how to just include our modal JavaScript:
+For instance, assuming you're using your own JavaScript bundler like Webpack, Parcel, or Vite, you'd only import the JavaScript you plan on using. In the example below, we show how to just include our modal JavaScript:
<!-- eslint-skip -->
```js
@@ -77,7 +77,7 @@ Whenever possible, be sure to compress all the code you serve to your visitors.
While minifying and using compression might seem like enough, making your files non-blocking ones is also a big step in making your site well-optimized and fast enough.
-If you are using a [Lighthouse](https://developers.google.com/web/tools/lighthouse/) plugin in Google Chrome, you may have stumbled over FCP. [The First Contentful Paint](https://web.dev/fcp/) metric measures the time from when the page starts loading to when any part of the page's content is rendered on the screen.
+If you are using a [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/) plugin in Google Chrome, you may have stumbled over FCP. [The First Contentful Paint](https://web.dev/fcp/) metric measures the time from when the page starts loading to when any part of the page's content is rendered on the screen.
You can improve FCP by deferring non-critical JavaScript or CSS. What does that mean? Simply, JavaScript or stylesheets that don't need to be present on the first paint of your page should be marked with `async` or `defer` attributes.
diff --git a/site/content/docs/5.2/customize/sass.md b/site/content/docs/5.2/customize/sass.md
index a80004e1bb..6215d1032d 100644
--- a/site/content/docs/5.2/customize/sass.md
+++ b/site/content/docs/5.2/customize/sass.md
@@ -215,9 +215,9 @@ In practice, you'd call the function and pass in the color and weight parameters
### Color contrast
-In order to meet [WCAG 2.0 accessibility standards for color contrast](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html), authors **must** provide [a contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG20/quickref/20160105/Overview.php#visual-audio-contrast-contrast), with very few exceptions.
+In order to meet the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG/) contrast requirements, authors **must** provide a minimum [text color contrast of 4.5:1](https://www.w3.org/TR/WCAG/#contrast-minimum) and a minimum [non-text color contrast of 3:1](https://www.w3.org/TR/WCAG/#non-text-contrast), with very few exceptions.
-An additional function we include in Bootstrap is the color contrast function, `color-contrast`. It utilizes the [WCAG 2.0 algorithm](https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests) for calculating contrast thresholds based on [relative luminance](https://www.w3.org/WAI/GL/wiki/Relative_luminance) in a `sRGB` color space to automatically return a light (`#fff`), dark (`#212529`) or black (`#000`) contrast color based on the specified base color. This function is especially useful for mixins or loops where you're generating multiple classes.
+To help with this, we included the `color-contrast` function in Bootstrap. It uses the [WCAG contrast ratio algorithm](https://www.w3.org/TR/WCAG/#dfn-contrast-ratio) for calculating contrast thresholds based on [relative luminance](https://www.w3.org/TR/WCAG/#dfn-relative-luminance) in an `sRGB` color space to automatically return a light (`#fff`), dark (`#212529`) or black (`#000`) contrast color based on the specified base color. This function is especially useful for mixins or loops where you're generating multiple classes.
For example, to generate color swatches from our `$theme-colors` map:
diff --git a/site/content/docs/5.2/examples/cheatsheet-rtl/index.html b/site/content/docs/5.2/examples/cheatsheet-rtl/index.html
index 2a1db691cf..093554ebda 100644
--- a/site/content/docs/5.2/examples/cheatsheet-rtl/index.html
+++ b/site/content/docs/5.2/examples/cheatsheet-rtl/index.html
@@ -913,10 +913,10 @@ direction: rtl
{{< example show_markup="false" >}}
<div class="btn-group w-100 align-items-center justify-content-between flex-wrap">
<div class="dropdown">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" id="dropdownMenuButtonSM" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButtonSM">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -926,10 +926,10 @@ direction: rtl
</ul>
</div>
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -939,10 +939,10 @@ direction: rtl
</ul>
</div>
<div class="dropdown">
- <button class="btn btn-secondary btn-lg dropdown-toggle" type="button" id="dropdownMenuButtonLG" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary btn-lg dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButtonLG">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -1026,10 +1026,10 @@ direction: rtl
{{< example show_markup="false" >}}
<div class="btn-group w-100 align-items-center justify-content-between flex-wrap">
<div class="dropend">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropendMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة لليسار
</button>
- <ul class="dropdown-menu" aria-labelledby="dropendMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -1039,10 +1039,10 @@ direction: rtl
</ul>
</div>
<div class="dropup">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropupMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة للأعلى
</button>
- <ul class="dropdown-menu" aria-labelledby="dropupMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -1052,10 +1052,10 @@ direction: rtl
</ul>
</div>
<div class="dropstart">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropstartMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
زر القائمة المنسدلة لليمين
</button>
- <ul class="dropdown-menu" aria-labelledby="dropstartMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -1070,10 +1070,10 @@ direction: rtl
{{< example show_markup="false" >}}
<div class="btn-group">
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownRightMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
قائمة منسدلة بمحاذاة نهاية الزر
</button>
- <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownRightMenuButton">
+ <ul class="dropdown-menu dropdown-menu-end">
<li><h6 class="dropdown-header">عنوان القائمة المنسدلة</h6></li>
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
@@ -1230,10 +1230,10 @@ direction: rtl
<a class="nav-link" href="#">رابط</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
قائمة منسدلة
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
<li><hr class="dropdown-divider"></li>
@@ -1269,10 +1269,10 @@ direction: rtl
<a class="nav-link" href="#">رابط</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
قائمة منسدلة
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdown2">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">عمل</a></li>
<li><a class="dropdown-item" href="#">عمل آخر</a></li>
<li><hr class="dropdown-divider"></li>
diff --git a/site/content/docs/5.2/examples/cheatsheet/index.html b/site/content/docs/5.2/examples/cheatsheet/index.html
index afd66d4fa8..8bbd5dc261 100644
--- a/site/content/docs/5.2/examples/cheatsheet/index.html
+++ b/site/content/docs/5.2/examples/cheatsheet/index.html
@@ -912,10 +912,10 @@ body_class: "bg-light"
{{< example show_markup="false" >}}
<div class="btn-group w-100 align-items-center justify-content-between flex-wrap">
<div class="dropdown">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" id="dropdownMenuButtonSM" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButtonSM">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -925,10 +925,10 @@ body_class: "bg-light"
</ul>
</div>
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -938,10 +938,10 @@ body_class: "bg-light"
</ul>
</div>
<div class="dropdown">
- <button class="btn btn-secondary btn-lg dropdown-toggle" type="button" id="dropdownMenuButtonLG" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary btn-lg dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenuButtonLG">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -1025,10 +1025,10 @@ body_class: "bg-light"
{{< example show_markup="false" >}}
<div class="btn-group w-100 align-items-center justify-content-between flex-wrap">
<div class="dropend">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropendMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropend button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropendMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -1038,10 +1038,10 @@ body_class: "bg-light"
</ul>
</div>
<div class="dropup">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropupMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropup button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropupMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -1051,10 +1051,10 @@ body_class: "bg-light"
</ul>
</div>
<div class="dropstart">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropstartMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropstart button
</button>
- <ul class="dropdown-menu" aria-labelledby="dropstartMenuButton">
+ <ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -1069,10 +1069,10 @@ body_class: "bg-light"
{{< example show_markup="false" >}}
<div class="btn-group">
<div class="dropdown">
- <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownRightMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
End-aligned menu
</button>
- <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownRightMenuButton">
+ <ul class="dropdown-menu dropdown-menu-end">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
@@ -1229,10 +1229,10 @@ body_class: "bg-light"
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
@@ -1268,10 +1268,10 @@ body_class: "bg-light"
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="navbarDropdown2">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
diff --git a/site/content/docs/5.2/examples/dashboard-rtl/index.html b/site/content/docs/5.2/examples/dashboard-rtl/index.html
index be8ef6a88c..bc41cc6043 100644
--- a/site/content/docs/5.2/examples/dashboard-rtl/index.html
+++ b/site/content/docs/5.2/examples/dashboard-rtl/index.html
@@ -28,7 +28,7 @@ extra_js:
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
- <div class="position-sticky pt-3">
+ <div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
diff --git a/site/content/docs/5.2/examples/dashboard/dashboard.css b/site/content/docs/5.2/examples/dashboard/dashboard.css
index 4426da7fe0..ad12048e76 100644
--- a/site/content/docs/5.2/examples/dashboard/dashboard.css
+++ b/site/content/docs/5.2/examples/dashboard/dashboard.css
@@ -32,10 +32,7 @@ body {
}
.sidebar-sticky {
- position: relative;
- top: 0;
height: calc(100vh - 48px);
- padding-top: .5rem;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}
diff --git a/site/content/docs/5.2/examples/dashboard/dashboard.rtl.css b/site/content/docs/5.2/examples/dashboard/dashboard.rtl.css
index a3f114f0ff..31ea3cc64e 100644
--- a/site/content/docs/5.2/examples/dashboard/dashboard.rtl.css
+++ b/site/content/docs/5.2/examples/dashboard/dashboard.rtl.css
@@ -28,10 +28,7 @@ body {
}
.sidebar-sticky {
- position: relative;
- top: 0;
height: calc(100vh - 48px);
- padding-top: .5rem;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}
diff --git a/site/content/docs/5.2/examples/dashboard/index.html b/site/content/docs/5.2/examples/dashboard/index.html
index 7e08308992..b3b40c266c 100644
--- a/site/content/docs/5.2/examples/dashboard/index.html
+++ b/site/content/docs/5.2/examples/dashboard/index.html
@@ -27,7 +27,7 @@ extra_js:
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
- <div class="position-sticky pt-3">
+ <div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
diff --git a/site/content/docs/5.2/examples/headers/index.html b/site/content/docs/5.2/examples/headers/index.html
index 5ef2eef163..b8fc8b27b8 100644
--- a/site/content/docs/5.2/examples/headers/index.html
+++ b/site/content/docs/5.2/examples/headers/index.html
@@ -137,10 +137,10 @@ body_class: ""
</form>
<div class="dropdown text-end">
- <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="mdo" width="32" height="32" class="rounded-circle">
</a>
- <ul class="dropdown-menu text-small" aria-labelledby="dropdownUser1">
+ <ul class="dropdown-menu text-small">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
@@ -157,10 +157,10 @@ body_class: ""
<header class="py-3 mb-3 border-bottom">
<div class="container-fluid d-grid gap-3 align-items-center" style="grid-template-columns: 1fr 2fr;">
<div class="dropdown">
- <a href="#" class="d-flex align-items-center col-lg-4 mb-2 mb-lg-0 link-dark text-decoration-none dropdown-toggle" id="dropdownNavLink" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-flex align-items-center col-lg-4 mb-2 mb-lg-0 link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"/></svg>
</a>
- <ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownNavLink">
+ <ul class="dropdown-menu text-small shadow">
<li><a class="dropdown-item active" href="#" aria-current="page">Overview</a></li>
<li><a class="dropdown-item" href="#">Inventory</a></li>
<li><a class="dropdown-item" href="#">Customers</a></li>
@@ -177,10 +177,10 @@ body_class: ""
</form>
<div class="flex-shrink-0 dropdown">
- <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" id="dropdownUser2" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="mdo" width="32" height="32" class="rounded-circle">
</a>
- <ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownUser2">
+ <ul class="dropdown-menu text-small shadow">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
diff --git a/site/content/docs/5.2/examples/navbar-bottom/index.html b/site/content/docs/5.2/examples/navbar-bottom/index.html
index 1a6399975f..c0e859ad0c 100644
--- a/site/content/docs/5.2/examples/navbar-bottom/index.html
+++ b/site/content/docs/5.2/examples/navbar-bottom/index.html
@@ -28,8 +28,8 @@ title: Bottom navbar example
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropup">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown10" data-bs-toggle="dropdown" aria-expanded="false">Dropup</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown10">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropup</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
diff --git a/site/content/docs/5.2/examples/navbars-offcanvas/index.html b/site/content/docs/5.2/examples/navbars-offcanvas/index.html
index b08ed63391..9099dc93ac 100644
--- a/site/content/docs/5.2/examples/navbars-offcanvas/index.html
+++ b/site/content/docs/5.2/examples/navbars-offcanvas/index.html
@@ -26,10 +26,10 @@ extra_css:
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="offcanvasNavbarDarkDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="offcanvasNavbarDarkDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li>
@@ -68,10 +68,10 @@ extra_css:
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="offcanvasNavbarLightDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="offcanvasNavbarLightDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li>
@@ -110,10 +110,10 @@ extra_css:
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="offcanvasNavbarLgDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
- <ul class="dropdown-menu" aria-labelledby="offcanvasNavbarLgDropdown">
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li>
diff --git a/site/content/docs/5.2/examples/navbars/index.html b/site/content/docs/5.2/examples/navbars/index.html
index f0a49c1d40..cc90b8ce09 100644
--- a/site/content/docs/5.2/examples/navbars/index.html
+++ b/site/content/docs/5.2/examples/navbars/index.html
@@ -25,8 +25,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown01">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -82,8 +82,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown03" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown03">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -116,8 +116,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown04">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -150,8 +150,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown05" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown05">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -184,8 +184,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown06" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown06">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -218,8 +218,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdownXxl" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdownXxl">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -252,8 +252,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown07" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown07">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -286,8 +286,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown07XL" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown07XL">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -323,8 +323,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown08" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown08">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -355,8 +355,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown09" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown09">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
@@ -388,8 +388,8 @@ extra_css:
<a class="nav-link disabled">Disabled</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown10" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown10">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
diff --git a/site/content/docs/5.2/examples/offcanvas-navbar/index.html b/site/content/docs/5.2/examples/offcanvas-navbar/index.html
index 667e73bb44..81c9bb4bbe 100644
--- a/site/content/docs/5.2/examples/offcanvas-navbar/index.html
+++ b/site/content/docs/5.2/examples/offcanvas-navbar/index.html
@@ -31,8 +31,8 @@ aliases: "/docs/5.2/examples/offcanvas/"
<a class="nav-link" href="#">Switch account</a>
</li>
<li class="nav-item dropdown">
- <a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-bs-toggle="dropdown" aria-expanded="false">Settings</a>
- <ul class="dropdown-menu" aria-labelledby="dropdown01">
+ <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Settings</a>
+ <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
diff --git a/site/content/docs/5.2/examples/sidebars/index.html b/site/content/docs/5.2/examples/sidebars/index.html
index 33a80e1f8a..48889faccb 100644
--- a/site/content/docs/5.2/examples/sidebars/index.html
+++ b/site/content/docs/5.2/examples/sidebars/index.html
@@ -110,11 +110,11 @@ body_class: ""
</ul>
<hr>
<div class="dropdown">
- <a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
<strong>mdo</strong>
</a>
- <ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
+ <ul class="dropdown-menu dropdown-menu-dark text-small shadow">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
@@ -166,11 +166,11 @@ body_class: ""
</ul>
<hr>
<div class="dropdown">
- <a href="#" class="d-flex align-items-center link-dark text-decoration-none dropdown-toggle" id="dropdownUser2" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-flex align-items-center link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
<strong>mdo</strong>
</a>
- <ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownUser2">
+ <ul class="dropdown-menu text-small shadow">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
@@ -215,10 +215,10 @@ body_class: ""
</li>
</ul>
<div class="dropdown border-top">
- <a href="#" class="d-flex align-items-center justify-content-center p-3 link-dark text-decoration-none dropdown-toggle" id="dropdownUser3" data-bs-toggle="dropdown" aria-expanded="false">
+ <a href="#" class="d-flex align-items-center justify-content-center p-3 link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="mdo" width="24" height="24" class="rounded-circle">
</a>
- <ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownUser3">
+ <ul class="dropdown-menu text-small shadow">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
diff --git a/site/content/docs/5.2/examples/starter-template/index.html b/site/content/docs/5.2/examples/starter-template/index.html
index e1eda9e304..a16984ab9b 100644
--- a/site/content/docs/5.2/examples/starter-template/index.html
+++ b/site/content/docs/5.2/examples/starter-template/index.html
@@ -40,6 +40,7 @@ extra_css:
<li class="d-flex align-items-start mb-1"><a href="{{< docsref "/getting-started/introduction" >}}">Bootstrap quick start guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="{{< docsref "/getting-started/webpack" >}}">Bootstrap Webpack guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="{{< docsref "/getting-started/parcel" >}}">Bootstrap Parcel guide</a></li>
+ <li class="d-flex align-items-start mb-1"><a href="{{< docsref "/getting-started/vite" >}}">Bootstrap Vite guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="{{< docsref "/getting-started/contribute" >}}">Contributing to Bootstrap</a></li>
</ul>
</div>
diff --git a/site/content/docs/5.2/forms/checks-radios.md b/site/content/docs/5.2/forms/checks-radios.md
index 812e7c198e..5c7ab52616 100644
--- a/site/content/docs/5.2/forms/checks-radios.md
+++ b/site/content/docs/5.2/forms/checks-radios.md
@@ -36,7 +36,7 @@ Our checks use custom Bootstrap icons to indicate checked or indeterminate state
Checkboxes can utilize the `:indeterminate` pseudo class when manually set via JavaScript (there is no available HTML attribute for specifying it).
-{{< example class="bd-example-indeterminate">}}
+{{< example class="bd-example-indeterminate" stackblitz_add_js="true" >}}
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckIndeterminate">
<label class="form-check-label" for="flexCheckIndeterminate">
diff --git a/site/content/docs/5.2/forms/form-control.md b/site/content/docs/5.2/forms/form-control.md
index 046004d7c0..4d6972d1df 100644
--- a/site/content/docs/5.2/forms/form-control.md
+++ b/site/content/docs/5.2/forms/form-control.md
@@ -31,7 +31,7 @@ Set heights using classes like `.form-control-lg` and `.form-control-sm`.
## Disabled
-Add the `disabled` boolean attribute on an input to give it a grayed out appearance and remove pointer events.
+Add the `disabled` boolean attribute on an input to give it a grayed out appearance, remove pointer events, and prevent focusing.
{{< example >}}
<input class="form-control" type="text" placeholder="Disabled input" aria-label="Disabled input example" disabled>
@@ -40,7 +40,7 @@ Add the `disabled` boolean attribute on an input to give it a grayed out appeara
## Readonly
-Add the `readonly` boolean attribute on an input to prevent modification of the input's value.
+Add the `readonly` boolean attribute on an input to prevent modification of the input's value. `readonly` inputs can still be focused and selected, while `disabled` inputs cannot.
{{< example >}}
<input class="form-control" type="text" value="Readonly input here..." aria-label="readonly input example" readonly>
@@ -48,7 +48,7 @@ Add the `readonly` boolean attribute on an input to prevent modification of the
## Readonly plain text
-If you want to have `<input readonly>` elements in your form styled as plain text, use the `.form-control-plaintext` class to remove the default form field styling and preserve the correct margin and padding.
+If you want to have `<input readonly>` elements in your form styled as plain text, replace `.form-control` with `.form-control-plaintext` to remove the default form field styling and preserve the correct `margin` and `padding`.
{{< example >}}
<div class="mb-3 row">
diff --git a/site/content/docs/5.2/getting-started/javascript.md b/site/content/docs/5.2/getting-started/javascript.md
index 0b79ef8912..fa157e006c 100644
--- a/site/content/docs/5.2/getting-started/javascript.md
+++ b/site/content/docs/5.2/getting-started/javascript.md
@@ -10,7 +10,7 @@ toc: true
Plugins can be included individually (using Bootstrap's individual `js/dist/*.js`), or all at once using `bootstrap.js` or the minified `bootstrap.min.js` (don't include both).
-If you use a bundler (Webpack, Rollup...), you can use `/js/dist/*.js` files which are UMD ready.
+If you use a bundler (Webpack, Parcel, Vite...), you can use `/js/dist/*.js` files which are UMD ready.
## Usage with JavaScript frameworks
@@ -19,7 +19,7 @@ While the Bootstrap CSS can be used with any framework, **the Bootstrap JavaScri
A better alternative for those using this type of frameworks is to use a framework-specific package **instead of** the Bootstrap JavaScript. Here are some of the most popular options:
- React: [React Bootstrap](https://react-bootstrap.github.io/)
-- Vue: [BootstrapVue](https://bootstrap-vue.org/)
+- Vue: [BootstrapVue](https://bootstrap-vue.org/) (currently only supports Vue 2 and Bootstrap 4)
- Angular: [ng-bootstrap](https://ng-bootstrap.github.io/)
## Using Bootstrap as a module
@@ -89,22 +89,19 @@ To fix this, you can use an `importmap` to resolve the arbitrary module names to
Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the docs.
-Our dropdowns, popovers and tooltips also depend on [Popper](https://popper.js.org/).
-
-## Still want to use jQuery? It's possible!
-
-Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. **If Bootstrap detects `jQuery` in the `window` object** it'll add all of our components in jQuery's plugin system; this means you'll be able to do `$('[data-bs-toggle="tooltip"]').tooltip()` to enable tooltips. The same goes for our other components.
+Our dropdowns, popovers, and tooltips also depend on [Popper](https://popper.js.org/).
## Data attributes
Nearly all Bootstrap plugins can be enabled and configured through HTML alone with data attributes (our preferred way of using JavaScript functionality). Be sure to **only use one set of data attributes on a single element** (e.g., you cannot trigger a tooltip and modal from the same button.)
-{{< callout warning >}}
+{{< markdown >}}
+{{< partial "js-data-attributes.md" >}}
+{{< /markdown >}}
+
## Selectors
-Currently to query DOM elements we use the native methods `querySelector` and `querySelectorAll` for performance reasons, so you have to use [valid selectors](https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier).
-If you use special selectors, for example: `collapse:Example` be sure to escape them.
-{{< /callout >}}
+We use the native `querySelector` and `querySelectorAll` methods to query DOM elements for performance reasons, so you must use [valid selectors](https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier). If you use special selectors like `collapse:Example`, be sure to escape them.
## Events
@@ -113,7 +110,7 @@ Bootstrap provides custom events for most plugins' unique actions. Generally, th
All infinitive events provide [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) functionality. This provides the ability to stop the execution of an action before it starts. Returning false from an event handler will also automatically call `preventDefault()`.
```js
-const myModal = document.getElementById('myModal')
+const myModal = document.querySelector('#myModal')
myModal.addEventListener('show.bs.modal', event => {
if (!data) {
@@ -122,58 +119,62 @@ myModal.addEventListener('show.bs.modal', event => {
})
```
-{{< callout warning >}}
-## jQuery events
+## Programmatic API
-Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-bs-no-jquery` attribute set on `<body>`. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`.
+All constructors accept an optional options object or nothing (which initiates a plugin with its default behavior):
```js
-$('#myTab a').on('shown.bs.tab', () => {
- // do something...
-})
-```
-{{< /callout >}}
+const myModalEl = document.querySelector('#myModal')
-## Programmatic API
+const modal = new bootstrap.Modal(myModalEl) // initialized with defaults
-All constructors accept an optional options object or nothing (which initiates a plugin with its default behavior):
+const configObject = { keyboard: false }
+const modal1 = new bootstrap.Modal(myModalEl, configObject) // initialized with no keyboard
+```
+
+If you'd like to get a particular plugin instance, each plugin exposes a `getInstance` method. For example, to retrieve an instance directly from an element:
```js
-const myModalEl = document.getElementById('myModal')
+bootstrap.Popover.getInstance(myPopoverEl)
+```
-const modal = new bootstrap.Modal(myModalEl) // initialized with defaults
-const modal1 = new bootstrap.Modal(myModalEl, { keyboard: false }) // initialized with no keyboard
+This method will return `null` if an instance is not initiated over the requested element.
+
+Alternatively, `getOrCreateInstance` can be used to get the instance associated with a DOM element, or create a new one in case it wasn't initialized.
+
+```js
+bootstrap.Popover.getOrCreateInstance(myPopoverEl, configObject)
```
-If you'd like to get a particular plugin instance, each plugin exposes a `getInstance` method. In order to retrieve it directly from an element, do this: `bootstrap.Popover.getInstance(myPopoverEl)`.
+In case an instance wasn't initialized, it may accept and use an optional configuration object as second argument.
### CSS selectors in constructors
-You can also use a CSS selector as the first argument instead of a DOM element to initialize the plugin. Currently the element for the plugin is found by the `querySelector` method since our plugins support a single element only.
+In addition to the `getInstance` and `getOrCreateInstance` methods, all plugin constructors can accept a DOM element or a valid [CSS selector](#selectors) as the first argument. Plugin elements are found with the `querySelector` method since our plugins only support a single element.
```js
const modal = new bootstrap.Modal('#myModal')
const dropdown = new bootstrap.Dropdown('[data-bs-toggle="dropdown"]')
+const offcanvas = bootstrap.Offcanvas.getInstance('#myOffcanvas')
+const alert = bootstrap.Alert.getOrCreateInstance('#myAlert')
```
### Asynchronous functions and transitions
-All programmatic API methods are **asynchronous** and return to the caller once the transition is started but **before it ends**.
-
-In order to execute an action once the transition is complete, you can listen to the corresponding event.
+All programmatic API methods are **asynchronous** and return to the caller once the transition is started, but **before it ends**. In order to execute an action once the transition is complete, you can listen to the corresponding event.
```js
-const myCollapseEl = document.getElementById('myCollapse')
+const myCollapseEl = document.querySelector('#myCollapse')
myCollapseEl.addEventListener('shown.bs.collapse', event => {
// Action to execute once the collapsible area is expanded
})
```
-In addition a method call on a **transitioning component will be ignored**.
+In addition, a method call on a **transitioning component will be ignored**.
```js
-const myCarouselEl = document.getElementById('myCarousel')
+const myCarouselEl = document.querySelector('#myCarousel')
const carousel = bootstrap.Carousel.getInstance(myCarouselEl) // Retrieve a Carousel instance
myCarouselEl.addEventListener('slid.bs.carousel', event => {
@@ -184,41 +185,46 @@ carousel.to('1') // Will start sliding to the slide 1 and returns to the caller
carousel.to('2') // !! Will be ignored, as the transition to the slide 1 is not finished !!
```
-### Default settings
+#### `dispose` method
-You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object:
+While it may seem correct to use the `dispose` method immediately after `hide()`, it will lead to incorrect results. Here's an example of the problem use:
```js
-// changes default for the modal plugin's `keyboard` option to false
-bootstrap.Modal.Default.keyboard = false
-```
-
-## No conflict (only if you use jQuery)
-
-Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call `.noConflict` on the plugin you wish to revert the value of.
+const myModal = document.querySelector('#myModal')
+myModal.hide() // it is asynchronous
-```js
-const bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
-$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
+myModal.addEventListener('shown.bs.hidden', event => {
+ myModal.dispose()
+})
```
-## Version numbers
+### Default settings
-The version of each of Bootstrap's plugins can be accessed via the `VERSION` property of the plugin's constructor. For example, for the tooltip plugin:
+You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object:
```js
-bootstrap.Tooltip.VERSION // => "{{< param current_version >}}"
+// changes default for the modal plugin's `keyboard` option to false
+bootstrap.Modal.Default.keyboard = false
```
-## No special fallbacks when JavaScript is disabled
+## Methods and properties
-Bootstrap's plugins don't fall back particularly gracefully when JavaScript is disabled. If you care about the user experience in this case, use [`<noscript>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript) to explain the situation (and how to re-enable JavaScript) to your users, and/or add your own custom fallbacks.
+Every Bootstrap plugin exposes the following methods and static properties.
-{{< callout warning >}}
-##### Third-party libraries
+{{< bs-table "table" >}}
+| Method | Description |
+| --- | --- |
+| `dispose` | Destroys an element's modal. (Removes stored data on the DOM element) |
+| `getInstance` | *Static* method which allows you to get the modal instance associated with a DOM element. |
+| `getOrCreateInstance` | *Static* method which allows you to get the modal instance associated with a DOM element, or create a new one in case it wasn't initialized. |
+{{< /bs-table >}}
-**Bootstrap does not officially support third-party JavaScript libraries** like Prototype or jQuery UI. Despite `.noConflict` and namespaced events, there may be compatibility problems that you need to fix on your own.
-{{< /callout >}}
+{{< bs-table "table" >}}
+| Static property | Description |
+| --- | --- |
+| `NAME` | Returns the plugin name. (Example: `bootstrap.Tooltip.NAME`) |
+| `VERSION` | The version of each of Bootstrap's plugins can be accessed via the `VERSION` property of the plugin's constructor (Example: `bootstrap.Tooltip.VERSION`) |
+{{< /bs-table >}}
## Sanitizer
@@ -283,10 +289,49 @@ myDefaultAllowList['*'].push(myCustomRegex)
If you want to bypass our sanitizer because you prefer to use a dedicated library, for example [DOMPurify](https://www.npmjs.com/package/dompurify), you should do the following:
```js
-const yourTooltipEl = document.getElementById('yourTooltip')
+const yourTooltipEl = document.querySelector('#yourTooltip')
const tooltip = new bootstrap.Tooltip(yourTooltipEl, {
sanitizeFn(content) {
return DOMPurify.sanitize(content)
}
})
```
+
+## Optionally using jQuery
+
+**You don't need jQuery in Bootstrap 5**, but it's still possible to use our components with jQuery. If Bootstrap detects `jQuery` in the `window` object, it'll add all of our components in jQuery's plugin system. This allows you to do the following:
+
+```js
+$('[data-bs-toggle="tooltip"]').tooltip() // to enable tooltips, with default configuration
+
+$('[data-bs-toggle="tooltip"]').tooltip({ boundary: 'clippingParents', customClass: 'myClass' }) // to initialize tooltips with given configuration
+
+$('#myTooltip').tooltip('show') // to trigger `show` method
+```
+
+The same goes for our other components.
+
+### No conflict
+
+Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call `.noConflict` on the plugin you wish to revert the value of.
+
+```js
+const bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
+$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
+```
+
+Bootstrap does not officially support third-party JavaScript libraries like Prototype or jQuery UI. Despite `.noConflict` and namespaced events, there may be compatibility problems that you need to fix on your own.
+
+### jQuery events
+
+Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-bs-no-jquery` attribute set on `<body>`. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`.
+
+```js
+$('#myTab a').on('shown.bs.tab', () => {
+ // do something...
+})
+```
+
+## Disabled JavaScript
+
+Bootstrap's plugins have no special fallback when JavaScript is disabled. If you care about the user experience in this case, use [`<noscript>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript) to explain the situation (and how to re-enable JavaScript) to your users, and/or add your own custom fallbacks.
diff --git a/site/content/docs/5.2/getting-started/vite.md b/site/content/docs/5.2/getting-started/vite.md
new file mode 100644
index 0000000000..ca0b61925e
--- /dev/null
+++ b/site/content/docs/5.2/getting-started/vite.md
@@ -0,0 +1,197 @@
+---
+layout: docs
+title: "Bootstrap & Vite"
+description: The official guide for how to include and bundle Bootstrap's CSS and JavaScript in your project using Vite.
+group: getting-started
+toc: true
+---
+
+<img class="mb-4 img-fluid rounded-3" srcset="/docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite.png, /docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite@2x.png 2x" src="/docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite.png" width="2000" height="1000" alt="">
+
+{{< callout >}}
+**Want to skip to the end?** Download the source code and working demo for this guide from the [twbs/examples repository](https://github.com/twbs/examples/tree/main/vite). You can also [open the example in StackBlitz](https://stackblitz.com/github/twbs/examples/tree/main/vite?file=index.html) for live editing.
+{{< /callout >}}
+
+## Setup
+
+We're building a Vite project with Bootstrap from scratch, so there are some prerequisites and up front steps before we can really get started. This guide requires you to have Node.js installed and some familiarity with the terminal.
+
+1. **Create a project folder and setup npm.** We'll create the `my-project` folder and initialize npm with the `-y` argument to avoid it asking us all the interactive questions.
+
+ ```sh
+ mkdir my-project && cd my-project
+ npm init -y
+ ```
+
+2. **Install Vite.** Unlike our Webpack guide, there’s only a single build tool dependency here. We use `--save-dev` to signal that this dependency is only for development use and not for production.
+
+ ```sh
+ npm i --save-dev vite
+ ```
+
+3. **Install Bootstrap.** Now we can install Bootstrap. We'll also install Popper since our dropdowns, popovers, and tooltips depend on it for their positioning. If you don't plan on using those components, you can omit Popper here.
+
+ ```sh
+ npm i --save bootstrap @popperjs/core
+ ```
+4. **Install additional dependency.** In addition to Vite and Bootstrap, we need another dependency (Sass) to properly import and bundle Bootstrap's CSS.
+
+ ```sh
+ npm i --save-dev sass
+ ```
+
+Now that we have all the necessary dependencies installed and setup, we can get to work creating the project files and importing Bootstrap.
+
+## Project structure
+
+We've already created the `my-project` folder and initialized npm. Now we'll also create our `src` folder, stylesheet, and JavaScript file to round out the project structure. Run the following from `my-project`, or manually create the folder and file structure shown below.
+
+```sh
+mkdir {src,src/js,src/scss}
+touch src/index.html src/js/main.js src/scss/styles.scss vite.config.js
+```
+
+When you're done, your complete project should look like this:
+
+```text
+my-project/
+├── src/
+│ ├── js/
+│ │ └── main.js
+│ └── scss/
+│ | └── styles.scss
+| └── index.html
+├── package-lock.json
+├── package.json
+└── vite.config.js
+```
+
+At this point, everything is in the right place, but Vite won't work because we haven't filled in our `vite.config.js` yet.
+
+## Configure Vite
+
+With dependencies installed and our project folder ready for us to start coding, we can now configure Vite and run our project locally.
+
+1. **Open `vite.config.js` in your editor.** Since it's blank, we'll need to add some boilerplate config to it so we can start our server. This part of the config tells Vite were to look for our project's JavaScript and how the development server should behave (pulling from the `src` folder with hot reload).
+
+ <!-- eslint-skip -->
+ ```js
+ const path = require('path')
+
+ export default {
+ root: path.resolve(__dirname, 'src'),
+ server: {
+ port: 8080,
+ hot: true
+ }
+ }
+ ```
+
+2. **Next we fill in `src/index.html`.** This is the HTML page Vite will load in the browser to utilize the bundled CSS and JS we'll add to it in later steps.
+
+ ```html
+ <!doctype html>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Bootstrap w/ Vite</title>
+ </head>
+ <body>
+ <div class="container py-4 px-3 mx-auto">
+ <h1>Hello, Bootstrap and Vite!</h1>
+ <button class="btn btn-primary">Primary button</button>
+ </div>
+ <script type="module" src="./js/main.js"></script>
+ </body>
+ </html>
+ ```
+
+ We're including a little bit of Bootstrap styling here with the `div class="container"` and `<button>` so that we see when Bootstrap's CSS is loaded by Vite.
+
+3. **Now we need an npm script to run Vite.** Open `package.json` and add the `start` script shown below (you should already have the test script). We'll use this script to start our local Vite dev server.
+
+ ```json
+ {
+ // ...
+ "scripts": {
+ "start": "vite",
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ // ...
+ }
+ ```
+
+4. **And finally, we can start Vite.** From the `my-project` folder in your terminal, run that newly added npm script:
+
+ ```sh
+ npm start
+ ```
+
+ <img class="img-fluid" src="/docs/{{< param docs_version >}}/assets/img/guides/vite-dev-server.png" alt="Vite dev server running">
+
+In the next and final section to this guide, we’ll import all of Bootstrap’s CSS and JavaScript.
+
+## Import Bootstrap
+
+1. **Set up Bootstrap's Sass import in `vite.config.js`.** Your configuration file is now complete and should match the snippet below. The only new part here is the `resolve` section—we use this to add an alias to our source files inside `node_modules` to keep imports as simple as possible.
+
+ <!-- eslint-skip -->
+ ```js
+ const path = require('path')
+
+ export default {
+ root: path.resolve(__dirname, 'src'),
+ resolve: {
+ alias: {
+ '~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
+ }
+ },
+ server: {
+ port: 8080,
+ hot: true
+ }
+ }
+ ```
+
+2. **Now, let's import Bootstrap's CSS.** Add the following to `src/scss/styles.scss` to import all of Bootstrap's source Sass.
+
+ ```scss
+ // Import all of Bootstrap's CSS
+ @import "~bootstrap/scss/bootstrap";
+ ```
+
+ *You can also import our stylesheets individually if you want. [Read our Sass import docs]({{< docsref "/customize/sass#importing" >}}) for details.*
+
+3. **Next we load the CSS and import Bootstrap's JavaScript.** Add the following to `src/js/main.js` to load the CSS and import all of Bootstrap's JS. Popper will be imported automatically through Bootstrap.
+
+ <!-- eslint-skip -->
+ ```js
+ // Import our custom CSS
+ import '../scss/styles.scss'
+
+ // Import all of Bootstrap's JS
+ import * as bootstrap from 'bootstrap'
+ ```
+
+ You can also import JavaScript plugins individually as needed to keep bundle sizes down:
+
+ <!-- eslint-skip -->
+ ```js
+ import Alert from 'bootstrap/js/dist/alert';
+
+ // or, specify which plugins you need:
+ import { Tooltip, Toast, Popover } from 'bootstrap';
+ ```
+
+ *[Read our JavaScript docs]({{< docsref "/getting-started/javascript/" >}}) for more information on how to use Bootstrap's plugins.*
+
+4. **And you're done! 🎉** With Bootstrap's source Sass and JS fully loaded, your local development server should now look like this.
+
+ <img class="img-fluid" src="/docs/{{< param docs_version >}}/assets/img/guides/vite-dev-server-bootstrap.png" alt="Vite dev server running with Bootstrap">
+
+ Now you can start adding any Bootstrap components you want to use. Be sure to [checkout the complete Vite example project](https://github.com/twbs/examples/tree/main/vite) for how to include additional custom Sass and optimize your build by importing only the parts of Bootstrap's CSS and JS that you need.
+
+{{< markdown >}}
+{{< partial "guide-footer.md" >}}
+{{< /markdown >}}
diff --git a/site/content/docs/5.2/getting-started/webpack.md b/site/content/docs/5.2/getting-started/webpack.md
index 015ea4efc8..e45df81e5d 100644
--- a/site/content/docs/5.2/getting-started/webpack.md
+++ b/site/content/docs/5.2/getting-started/webpack.md
@@ -93,7 +93,7 @@ With dependencies installed and our project folder ready for us to start coding,
}
```
-2. **Next we create our `dist/index.html`.** This is the HTML page Webpack will load in the browser to utilize the bundled CSS and JS we'll add to it in later steps. Before we can do that, we have to give it something to render and include the `output` JS from the previous step.
+2. **Next we fill in our `dist/index.html`.** This is the HTML page Webpack will load in the browser to utilize the bundled CSS and JS we'll add to it in later steps. Before we can do that, we have to give it something to render and include the `output` JS from the previous step.
```html
<!doctype html>
@@ -142,7 +142,7 @@ In the next and final section to this guide, we'll setup the Webpack loaders and
Importing Bootstrap into Webpack requires the loaders we installed in the first section. We've installed them with npm, but now Webpack needs to be configured to use them.
-1. **Setup the loaders in `webpack.config.js`.** Your configuration file is now complete and should match the snippet below. The only new part here is the `module` section.
+1. **Set up the loaders in `webpack.config.js`.** Your configuration file is now complete and should match the snippet below. The only new part here is the `module` section.
```js
const path = require('path')
diff --git a/site/content/docs/5.2/layout/grid.md b/site/content/docs/5.2/layout/grid.md
index 765b7eb603..9d147239fe 100644
--- a/site/content/docs/5.2/layout/grid.md
+++ b/site/content/docs/5.2/layout/grid.md
@@ -63,77 +63,79 @@ Bootstrap's grid system can adapt across all six default breakpoints, and any br
As noted above, each of these breakpoints have their own container, unique class prefix, and modifiers. Here's how the grid changes across these breakpoints:
-<table class="table mb-4">
- <thead>
- <tr>
- <th scope="col"></th>
- <th scope="col">
- xs<br>
- <span class="fw-normal">&lt;576px</span>
- </th>
- <th scope="col">
- sm<br>
- <span class="fw-normal">&ge;576px</span>
- </th>
- <th scope="col">
- md<br>
- <span class="fw-normal">&ge;768px</span>
- </th>
- <th scope="col">
- lg<br>
- <span class="fw-normal">&ge;992px</span>
- </th>
- <th scope="col">
- xl<br>
- <span class="fw-normal">&ge;1200px</span>
- </th>
- <th scope="col">
- xxl<br>
- <span class="fw-normal">&ge;1400px</span>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th class="text-nowrap" scope="row">Container <code class="fw-normal">max-width</code></th>
- <td>None (auto)</td>
- <td>540px</td>
- <td>720px</td>
- <td>960px</td>
- <td>1140px</td>
- <td>1320px</td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row">Class prefix</th>
- <td><code>.col-</code></td>
- <td><code>.col-sm-</code></td>
- <td><code>.col-md-</code></td>
- <td><code>.col-lg-</code></td>
- <td><code>.col-xl-</code></td>
- <td><code>.col-xxl-</code></td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row"># of columns</th>
- <td colspan="6">12</td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row">Gutter width</th>
- <td colspan="6">1.5rem (.75rem on left and right)</td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row">Custom gutters</th>
- <td colspan="6"><a href="{{< docsref "/layout/gutters" >}}">Yes</a></td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row">Nestable</th>
- <td colspan="6"><a href="#nesting">Yes</a></td>
- </tr>
- <tr>
- <th class="text-nowrap" scope="row">Column ordering</th>
- <td colspan="6"><a href="{{< docsref "/layout/columns#reordering" >}}">Yes</a></td>
- </tr>
- </tbody>
-</table>
+<div class="table-responsive">
+ <table class="table mb-4">
+ <thead>
+ <tr>
+ <th scope="col"></th>
+ <th scope="col">
+ xs<br>
+ <span class="fw-normal">&lt;576px</span>
+ </th>
+ <th scope="col">
+ sm<br>
+ <span class="fw-normal">&ge;576px</span>
+ </th>
+ <th scope="col">
+ md<br>
+ <span class="fw-normal">&ge;768px</span>
+ </th>
+ <th scope="col">
+ lg<br>
+ <span class="fw-normal">&ge;992px</span>
+ </th>
+ <th scope="col">
+ xl<br>
+ <span class="fw-normal">&ge;1200px</span>
+ </th>
+ <th scope="col">
+ xxl<br>
+ <span class="fw-normal">&ge;1400px</span>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th class="text-nowrap" scope="row">Container <code class="fw-normal">max-width</code></th>
+ <td>None (auto)</td>
+ <td>540px</td>
+ <td>720px</td>
+ <td>960px</td>
+ <td>1140px</td>
+ <td>1320px</td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row">Class prefix</th>
+ <td><code>.col-</code></td>
+ <td><code>.col-sm-</code></td>
+ <td><code>.col-md-</code></td>
+ <td><code>.col-lg-</code></td>
+ <td><code>.col-xl-</code></td>
+ <td><code>.col-xxl-</code></td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row"># of columns</th>
+ <td colspan="6">12</td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row">Gutter width</th>
+ <td colspan="6">1.5rem (.75rem on left and right)</td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row">Custom gutters</th>
+ <td colspan="6"><a href="{{< docsref "/layout/gutters" >}}">Yes</a></td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row">Nestable</th>
+ <td colspan="6"><a href="#nesting">Yes</a></td>
+ </tr>
+ <tr>
+ <th class="text-nowrap" scope="row">Column ordering</th>
+ <td colspan="6"><a href="{{< docsref "/layout/columns#reordering" >}}">Yes</a></td>
+ </tr>
+ </tbody>
+ </table>
+</div>
## Auto-layout columns
diff --git a/site/content/docs/5.2/migration.md b/site/content/docs/5.2/migration.md
index 9750e4e77a..dbeb8f60c8 100644
--- a/site/content/docs/5.2/migration.md
+++ b/site/content/docs/5.2/migration.md
@@ -388,6 +388,7 @@ Want more information? [Read the v5.1.0 blog post.](https://blog.getbootstrap.co
### Navbars
- <span class="badge bg-danger">Breaking</span> Navbars now require a container within (to drastically simplify spacing requirements and CSS required).
+- <span class="badge bg-danger">Breaking</span> The `.active` class can no longer be applied to `.nav-item`s, it must be applied directly on `.nav-link`s.
### Offcanvas
diff --git a/site/content/docs/5.2/utilities/api.md b/site/content/docs/5.2/utilities/api.md
index ef6d9ac1eb..81017ee8eb 100644
--- a/site/content/docs/5.2/utilities/api.md
+++ b/site/content/docs/5.2/utilities/api.md
@@ -392,7 +392,6 @@ New utilities can be added to the default `$utilities` map with a `map-merge`. M
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
-@import "bootstrap/scss/utilities/api";
$utilities: map-merge(
$utilities,
@@ -405,6 +404,8 @@ $utilities: map-merge(
)
)
);
+
+@import "bootstrap/scss/utilities/api";
```
### Modify utilities
@@ -417,7 +418,6 @@ Modify existing utilities in the default `$utilities` map with `map-get` and `ma
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
-@import "bootstrap/scss/utilities/api";
$utilities: map-merge(
$utilities,
@@ -433,6 +433,8 @@ $utilities: map-merge(
),
)
);
+
+@import "bootstrap/scss/utilities/api";
```
#### Enable responsive
@@ -445,7 +447,6 @@ You can enable responsive classes for an existing set of utilities that are not
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
-@import "bootstrap/scss/utilities/api";
$utilities: map-merge(
$utilities, (
@@ -455,6 +456,8 @@ $utilities: map-merge(
),
)
);
+
+@import "bootstrap/scss/utilities/api";
```
This will now generate responsive variations of `.border` and `.border-0` for each breakpoint. Your generated CSS will look like this:
@@ -499,7 +502,6 @@ Missing v4 utilities, or used to another naming convention? The utilities API ca
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
-@import "bootstrap/scss/utilities/api";
$utilities: map-merge(
$utilities, (
@@ -509,11 +511,13 @@ $utilities: map-merge(
),
)
);
+
+@import "bootstrap/scss/utilities/api";
```
### Remove utilities
-Remove any of the default utilities by setting the group key to `null`. For example, to remove all our `width` utilities, create a `$utilities` `map-merge` and add `"width": null` within.
+Remove any of the default utilities with the [`map-remove()` Sass function](https://sass-lang.com/documentation/modules/map#remove).
```scss
@import "bootstrap/scss/functions";
@@ -521,7 +525,21 @@ Remove any of the default utilities by setting the group key to `null`. For exam
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
+
+// Remove multiple utilities with a comma-separated list
+$utilities: map-remove($utilities, "width", "float");
+
@import "bootstrap/scss/utilities/api";
+```
+
+You can also use the [`map-merge()` Sass function](https://sass-lang.com/documentation/modules/map#merge) and set the group key to `null` to remove the utility.
+
+```scss
+@import "bootstrap/scss/functions";
+@import "bootstrap/scss/variables";
+@import "bootstrap/scss/maps";
+@import "bootstrap/scss/mixins";
+@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities,
@@ -529,6 +547,44 @@ $utilities: map-merge(
"width": null
)
);
+
+@import "bootstrap/scss/utilities/api";
+```
+
+### Add, remove, modify
+
+You can add, remove, and modify many utilities all at once with the [`map-merge()` Sass function](https://sass-lang.com/documentation/modules/map#merge). Here's how you can combine the previous examples into one larger map.
+
+```scss
+@import "bootstrap/scss/functions";
+@import "bootstrap/scss/variables";
+@import "bootstrap/scss/maps";
+@import "bootstrap/scss/mixins";
+@import "bootstrap/scss/utilities";
+
+$utilities: map-merge(
+ $utilities,
+ (
+ // Remove the `width` utility
+ "width": null,
+
+ // Make an existing utility responsive
+ "border": map-merge(
+ map-get($utilities, "border"),
+ ( responsive: true ),
+ ),
+
+ // Add new utilities
+ "cursor": (
+ property: cursor,
+ class: cursor,
+ responsive: true,
+ values: auto pointer grab,
+ )
+ )
+);
+
+@import "bootstrap/scss/utilities/api";
```
#### Remove utility in RTL