diff options
| author | XhmikosR <[email protected]> | 2021-09-09 15:01:58 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-09 15:01:58 +0300 |
| commit | e961454738f4033eb2be68bde4b257ea9e0a7765 (patch) | |
| tree | 507ca252e706a9c692b133b6e18fb8504c488837 /site/content/docs/5.1 | |
| parent | 86d5d5ea79e8eaa15a28b9da92bbee53036640f6 (diff) | |
| parent | 1df098361cac04217d6a464c80e890c4335ecb5c (diff) | |
| download | bootstrap-main-xmr-docs-render-heading.tar.xz bootstrap-main-xmr-docs-render-heading.zip | |
Merge branch 'main' into main-xmr-docs-render-headingmain-xmr-docs-render-heading
Diffstat (limited to 'site/content/docs/5.1')
42 files changed, 134 insertions, 131 deletions
diff --git a/site/content/docs/5.1/components/alerts.md b/site/content/docs/5.1/components/alerts.md index 1df07983e..6127279f5 100644 --- a/site/content/docs/5.1/components/alerts.md +++ b/site/content/docs/5.1/components/alerts.md @@ -27,20 +27,10 @@ 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 >}} <div id="liveAlertPlaceholder"></div> - -<div class="bd-example"> - <button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button> -</div> - -```html <button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button> - -<div class="alert alert-primary alert-dismissible" role="alert" id="liveAlert"> - <strong>Nice!</strong> You've triggered this alert. - <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> -</div> -``` +{{< /example >}} We use the following JavaScript to trigger our live alert demo: @@ -248,7 +238,7 @@ See the [triggers](#triggers) section for more details. <code>getOrCreateInstance</code> </td> <td> - Static method which returns an alert instance associated to a DOM element or create a new one in case it wasn't initialised. + Static method which returns an alert instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: <code>bootstrap.Alert.getOrCreateInstance(element)</code> </td> </tr> diff --git a/site/content/docs/5.1/components/buttons.md b/site/content/docs/5.1/components/buttons.md index d62d6e2b6..1f279ffd7 100644 --- a/site/content/docs/5.1/components/buttons.md +++ b/site/content/docs/5.1/components/buttons.md @@ -85,18 +85,22 @@ Disabled buttons using the `<a>` element behave a bit different: - `<a>`s don't support the `disabled` attribute, so you must add the `.disabled` class to make it visually appear disabled. - Some future-friendly styles are included to disable all `pointer-events` on anchor buttons. -- Disabled buttons should include the `aria-disabled="true"` attribute to indicate the state of the element to assistive technologies. +- Disabled buttons using `<a>` should include the `aria-disabled="true"` attribute to indicate the state of the element to assistive technologies. +- Disabled buttons using `<a>` *should not* include the `href` attribute. {{< example >}} -<a href="#" class="btn btn-primary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a> -<a href="#" class="btn btn-secondary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a> +<a class="btn btn-primary btn-lg disabled" role="button" aria-disabled="true">Primary link</a> +<a class="btn btn-secondary btn-lg disabled" role="button" aria-disabled="true">Link</a> {{< /example >}} -{{< callout warning >}} -##### Link functionality caveat +### Link functionality caveat -The `.disabled` class uses `pointer-events: none` to try to disable the link functionality of `<a>`s, but that CSS property is not yet standardized. In addition, even in browsers that do support `pointer-events: none`, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, in addition to `aria-disabled="true"`, also include a `tabindex="-1"` attribute on these links to prevent them from receiving keyboard focus, and use custom JavaScript to disable their functionality altogether. -{{< /callout >}} +To cover cases where you have to keep the `href` attribute on a disabled link, the `.disabled` class uses `pointer-events: none` to try to disable the link functionality of `<a>`s. Note that this CSS property is not yet standardized for HTML, but all modern browsers support it. In addition, even in browsers that do support `pointer-events: none`, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, in addition to `aria-disabled="true"`, also include a `tabindex="-1"` attribute on these links to prevent them from receiving keyboard focus, and use custom JavaScript to disable their functionality altogether. + +{{< example >}} +<a href="#" class="btn btn-primary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a> +<a href="#" class="btn btn-secondary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a> +{{< /example >}} ## Block buttons @@ -157,7 +161,7 @@ Add `data-bs-toggle="button"` to toggle a button's `active` state. If you're pre {{< example >}} <a href="#" class="btn btn-primary" role="button" data-bs-toggle="button">Toggle link</a> <a href="#" class="btn btn-primary active" role="button" data-bs-toggle="button" aria-pressed="true">Active toggle link</a> -<a href="#" class="btn btn-primary disabled" tabindex="-1" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a> +<a class="btn btn-primary disabled" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a> {{< /example >}} ### Methods @@ -206,7 +210,7 @@ var bsButton = new bootstrap.Button(button) <code>getOrCreateInstance</code> </td> <td> - Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialised. + Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: <code>bootstrap.Button.getOrCreateInstance(element)</code> </td> </tr> diff --git a/site/content/docs/5.1/components/card.md b/site/content/docs/5.1/components/card.md index 97bcf77d5..3effb21d0 100644 --- a/site/content/docs/5.1/components/card.md +++ b/site/content/docs/5.1/components/card.md @@ -309,7 +309,7 @@ Add some navigation to a card's header (or block) with Bootstrap's [nav componen <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> </div> @@ -332,7 +332,7 @@ Add some navigation to a card's header (or block) with Bootstrap's [nav componen <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> </div> diff --git a/site/content/docs/5.1/components/carousel.md b/site/content/docs/5.1/components/carousel.md index e106e76c0..5a060f26f 100644 --- a/site/content/docs/5.1/components/carousel.md +++ b/site/content/docs/5.1/components/carousel.md @@ -425,7 +425,7 @@ var carousel = new bootstrap.Carousel(myCarousel, { <code>getOrCreateInstance</code> </td> <td> - Static method which returns a carousel instance associated to a DOM element or create a new one in case it wasn't initialised. + Static method which returns a carousel instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: <code>bootstrap.Carousel.getOrCreateInstance(element)</code> </td> </tr> diff --git a/site/content/docs/5.1/components/collapse.md b/site/content/docs/5.1/components/collapse.md index 5d413ad75..1e1b58c29 100644 --- a/site/content/docs/5.1/components/collapse.md +++ b/site/content/docs/5.1/components/collapse.md @@ -222,7 +222,7 @@ var bsCollapse = new bootstrap.Collapse(myCollapse, { <code>getOrCreateInstance</code> </td> <td> - Static method which returns a collapse instance associated to a DOM element or create a new one in case it wasn't initialised. + Static method which returns a collapse instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: <code>bootstrap.Collapse.getOrCreateInstance(element)</code> </td> </tr> diff --git a/site/content/docs/5.1/components/dropdowns.md b/site/content/docs/5.1/components/dropdowns.md index 1668ae7bd..738940fc9 100644 --- a/site/content/docs/5.1/components/dropdowns.md +++ b/site/content/docs/5.1/components/dropdowns.md @@ -628,7 +628,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**. {{< example >}} <ul class="dropdown-menu"> <li><a class="dropdown-item" href="#">Regular link</a></li> - <li><a class="dropdown-item disabled" href="#" tabindex="-1" aria-disabled="true">Disabled link</a></li> + <li><a class="dropdown-item disabled">Disabled link</a></li> <li><a class="dropdown-item" href="#">Another link</a></li> </ul> {{< /example >}} @@ -1148,7 +1148,7 @@ var dropdown = new bootstrap.Dropdown(element, { <code>getOrCreateInstance</code> </td> <td> - Static method which returns a dropdown instance associated to a DOM element or create a new one in case it wasn't initialised. + Static method which returns a dropdown instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: <code>bootstrap.Dropdown.getOrCreateInstance(element)</code> </td> </tr> diff --git a/site/content/docs/5.1/components/list-group.md b/site/content/docs/5.1/components/list-group.md index c49541bdb..c47a05dd3 100644 --- a/site/content/docs/5.1/components/list-group.md +++ b/site/content/docs/5.1/components/list-group.md @@ -62,7 +62,7 @@ Be sure to **not use the standard `.btn` classes here**. <a href="#" class="list-group-item list-group-item-action">A second link item</a> <a href="#" class="list-group-item list-group-item-action">A third link item</a> <a href="#" class="list-group-item list-group-item-action">A fourth link item</a> - <a href="#" class="list-group-item list-group-item-action disabled" tabindex="-1" aria-disabled="true">A disabled link item</a> + <a class="list-group-item list-group-item-action disabled">A disabled link item</a> </div> {{< /example >}} @@ -486,7 +486,7 @@ var tab = bootstrap.Tab.getInstance(triggerEl) // Returns a Bootstrap tab instan #### getOrCreateInstance -*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var triggerEl = document.querySelector('#trigger') diff --git a/site/content/docs/5.1/components/modal.md b/site/content/docs/5.1/components/modal.md index 118dc842f..8960eb5bb 100644 --- a/site/content/docs/5.1/components/modal.md +++ b/site/content/docs/5.1/components/modal.md @@ -224,7 +224,7 @@ You can also create a scrollable modal that allows scroll the modal body by addi <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> - <p>This is some placeholder content to show the scrolling behavior for modals. We use repeated line breaks to demonstrate how content can exceed minimum inner height, thereby showing inner scrolling. When content becomes longer than the prefedined max-height of modal, content will be cropped and scrollable within the modal.</p> + <p>This is some placeholder content to show the scrolling behavior for modals. We use repeated line breaks to demonstrate how content can exceed minimum inner height, thereby showing inner scrolling. When content becomes longer than the predefined max-height of modal, content will be cropped and scrollable within the modal.</p> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <p>This content should appear at the bottom after you scroll.</p> </div> @@ -279,7 +279,7 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> - <p>This is some placeholder content to show a vertically centered modal. We've added some extra copy here to show how vertically centering the modal works when combined with scrollable modals. We also use some repeated line breaks to quickly extend the height of the content, thereby triggering the scrolling. When content becomes longer than the prefedined max-height of modal, content will be cropped and scrollable within the modal.</p> + <p>This is some placeholder content to show a vertically centered modal. We've added some extra copy here to show how vertically centering the modal works when combined with scrollable modals. We also use some repeated line breaks to quickly extend the height of the content, thereby triggering the scrolling. When content becomes longer than the predefined max-height of modal, content will be cropped and scrollable within the modal.</p> <br><br><br><br><br><br><br><br><br><br> <p>Just like that.</p> </div> @@ -964,7 +964,7 @@ var modal = bootstrap.Modal.getInstance(myModalEl) // Returns a Bootstrap modal #### 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 initialised +*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 ```js var myModalEl = document.querySelector('#myModal') diff --git a/site/content/docs/5.1/components/navbar.md b/site/content/docs/5.1/components/navbar.md index 1abfcd16c..f6dbb8e61 100644 --- a/site/content/docs/5.1/components/navbar.md +++ b/site/content/docs/5.1/components/navbar.md @@ -62,7 +62,7 @@ Here's an example of all the sub-components included in a responsive light-theme </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> @@ -156,7 +156,7 @@ Please note that you should also add the `aria-current` attribute on the active <a class="nav-link" href="#">Pricing</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> </div> @@ -178,7 +178,7 @@ And because we use classes for our navs, you can avoid the list-based approach e <a class="nav-link active" aria-current="page" href="#">Home</a> <a class="nav-link" href="#">Features</a> <a class="nav-link" href="#">Pricing</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </div> </div> </div> @@ -521,7 +521,7 @@ Here's an example navbar using `.navbar-nav-scroll` with `style="--bs-scroll-hei </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Link</a> + <a class="nav-link disabled">Link</a> </li> </ul> <form class="d-flex"> @@ -561,7 +561,7 @@ With no `.navbar-brand` shown at the smallest breakpoint: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> @@ -591,7 +591,7 @@ With a brand name shown on the left and toggler on the right: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> @@ -621,7 +621,7 @@ With a toggler on the left and brand name on the right: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/components/navs-tabs.md b/site/content/docs/5.1/components/navs-tabs.md index 043a04f5b..353d03d2d 100644 --- a/site/content/docs/5.1/components/navs-tabs.md +++ b/site/content/docs/5.1/components/navs-tabs.md @@ -31,7 +31,7 @@ To convey the active state to assistive technologies, use the `aria-current` att <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -43,7 +43,7 @@ Classes are used throughout, so your markup can be super flexible. Use `<ul>`s l <a class="nav-link active" aria-current="page" href="#">Active</a> <a class="nav-link" href="#">Link</a> <a class="nav-link" href="#">Link</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -69,7 +69,7 @@ Centered with `.justify-content-center`: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -88,7 +88,7 @@ Right-aligned with `.justify-content-end`: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -109,7 +109,7 @@ Stack your navigation by changing the flex item direction with the `.flex-column <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -121,7 +121,7 @@ As always, vertical navigation is possible without `<ul>`s, too. <a class="nav-link active" aria-current="page" href="#">Active</a> <a class="nav-link" href="#">Link</a> <a class="nav-link" href="#">Link</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -141,7 +141,7 @@ Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabb <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -162,7 +162,7 @@ Take that same HTML, but use `.nav-pills` instead: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -183,7 +183,7 @@ Force your `.nav`'s contents to extend the full available width one of two modif <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -195,7 +195,7 @@ When using a `<nav>`-based navigation, you can safely omit `.nav-item` as only ` <a class="nav-link active" aria-current="page" href="#">Active</a> <a class="nav-link" href="#">Much longer nav link</a> <a class="nav-link" href="#">Link</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -213,7 +213,7 @@ For equal-width elements, use `.nav-justified`. All horizontal space will be occ <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -225,7 +225,7 @@ Similar to the `.nav-fill` example using a `<nav>`-based navigation. <a class="nav-link active" aria-current="page" href="#">Active</a> <a class="nav-link" href="#">Much longer nav link</a> <a class="nav-link" href="#">Link</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -238,7 +238,7 @@ If you need responsive nav variations, consider using a series of [flexbox utili <a class="flex-sm-fill text-sm-center nav-link active" aria-current="page" href="#">Active</a> <a class="flex-sm-fill text-sm-center nav-link" href="#">Longer nav link</a> <a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a> - <a class="flex-sm-fill text-sm-center nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="flex-sm-fill text-sm-center nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -273,7 +273,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -299,7 +299,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -626,7 +626,7 @@ var tab = bootstrap.Tab.getInstance(triggerEl) // Returns a Bootstrap tab instan #### getOrCreateInstance -*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var triggerEl = document.querySelector('#trigger') diff --git a/site/content/docs/5.1/components/offcanvas.md b/site/content/docs/5.1/components/offcanvas.md index c28e005e6..6be2cd64d 100644 --- a/site/content/docs/5.1/components/offcanvas.md +++ b/site/content/docs/5.1/components/offcanvas.md @@ -161,7 +161,7 @@ Scrolling the `<body>` element is disabled when an offcanvas and its backdrop ar </div> <div class="offcanvas offcanvas-start" data-bs-scroll="true" tabindex="-1" id="offcanvasWithBothOptions" aria-labelledby="offcanvasWithBothOptionsLabel"> <div class="offcanvas-header"> - <h5 class="offcanvas-title" id="offcanvasWithBothOptionsLabel">Backdroped with scrolling</h5> + <h5 class="offcanvas-title" id="offcanvasWithBothOptionsLabel">Backdrop with scrolling</h5> <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> <div class="offcanvas-body"> @@ -251,7 +251,7 @@ var bsOffcanvas = new bootstrap.Offcanvas(myOffcanvas) | `show` | Shows an offcanvas element. **Returns to the caller before the offcanvas element has actually been shown** (i.e. before the `shown.bs.offcanvas` event occurs).| | `hide` | Hides an offcanvas element. **Returns to the caller before the offcanvas element has actually been hidden** (i.e. before the `hidden.bs.offcanvas` event occurs).| | `getInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element | -| `getOrCreateInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element, or create a new one in case it wasn't initialised | +| `getOrCreateInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element, or create a new one in case it wasn't initialized | {{< /bs-table >}} ### Events diff --git a/site/content/docs/5.1/components/pagination.md b/site/content/docs/5.1/components/pagination.md index 6b7c7a3da..7e70a77e1 100644 --- a/site/content/docs/5.1/components/pagination.md +++ b/site/content/docs/5.1/components/pagination.md @@ -58,7 +58,7 @@ While the `.disabled` class uses `pointer-events: none` to _try_ to disable the <nav aria-label="..."> <ul class="pagination"> <li class="page-item disabled"> - <a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a> + <a class="page-link">Previous</a> </li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"> @@ -128,7 +128,7 @@ Change the alignment of pagination components with [flexbox utilities]({{< docsr <nav aria-label="Page navigation example"> <ul class="pagination justify-content-center"> <li class="page-item disabled"> - <a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a> + <a class="page-link">Previous</a> </li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">2</a></li> @@ -144,7 +144,7 @@ Change the alignment of pagination components with [flexbox utilities]({{< docsr <nav aria-label="Page navigation example"> <ul class="pagination justify-content-end"> <li class="page-item disabled"> - <a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a> + <a class="page-link">Previous</a> </li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">2</a></li> diff --git a/site/content/docs/5.1/components/placeholders.md b/site/content/docs/5.1/components/placeholders.md index cfbaf1672..7b380b603 100644 --- a/site/content/docs/5.1/components/placeholders.md +++ b/site/content/docs/5.1/components/placeholders.md @@ -82,11 +82,11 @@ We apply additional styling to `.btn`s via `::before` to ensure the `height` is <span class="placeholder col-6"></span> </p> -<a href="#" class="btn btn-primary disabled placeholder col-4" aria-hidden="true"></a> +<a href="#" tabindex="-1" class="btn btn-primary disabled placeholder col-4" aria-hidden="true"></a> {{< /example >}} {{< callout info >}} -The use of `aria-hidden="true"` only indicates that the element should be hidden to screen readers. The *loading* behaviour of the placeholder depends on how authors will actually use the placeholder styles, how they plan to update things, etc. Some JavasSript code may be needed to *swap* the state of the placeholder and inform AT users of the update. +The use of `aria-hidden="true"` only indicates that the element should be hidden to screen readers. The *loading* behavior of the placeholder depends on how authors will actually use the placeholder styles, how they plan to update things, etc. Some JavaScript code may be needed to *swap* the state of the placeholder and inform AT users of the update. {{< /callout >}} ### Width diff --git a/site/content/docs/5.1/components/popovers.md b/site/content/docs/5.1/components/popovers.md index 06aa656d9..4511645ce 100644 --- a/site/content/docs/5.1/components/popovers.md +++ b/site/content/docs/5.1/components/popovers.md @@ -395,7 +395,7 @@ var popover = bootstrap.Popover.getInstance(exampleTriggerEl) // Returns a Boots #### getOrCreateInstance -*Static* method which allows you to get the popover instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the popover instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var exampleTriggerEl = document.getElementById('example') diff --git a/site/content/docs/5.1/components/progress.md b/site/content/docs/5.1/components/progress.md index 1b59dc97a..fccd546c6 100644 --- a/site/content/docs/5.1/components/progress.md +++ b/site/content/docs/5.1/components/progress.md @@ -123,20 +123,11 @@ Add `.progress-bar-striped` to any `.progress-bar` to apply a stripe via CSS gra The striped gradient can also be animated. Add `.progress-bar-animated` to `.progress-bar` to animate the stripes right to left via CSS3 animations. -<div class="bd-example"> - <div class="progress"> - <div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div> - </div> - <button type="button" class="btn btn-secondary mt-3" data-bs-toggle="button" id="btnToggleAnimatedProgress" aria-pressed="false" autocomplete="off"> - Toggle animation - </button> -</div> - -```html +{{< example >}} <div class="progress"> <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div> </div> -``` +{{< /example >}} ## Sass diff --git a/site/content/docs/5.1/components/scrollspy.md b/site/content/docs/5.1/components/scrollspy.md index 580a1e2d5..bcd9fb78a 100644 --- a/site/content/docs/5.1/components/scrollspy.md +++ b/site/content/docs/5.1/components/scrollspy.md @@ -300,7 +300,7 @@ var scrollSpy = bootstrap.ScrollSpy.getInstance(scrollSpyContentEl) // Returns a #### getOrCreateInstance -*Static* method which allows you to get the scrollspy instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the scrollspy instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var scrollSpyContentEl = document.getElementById('content') diff --git a/site/content/docs/5.1/components/toasts.md b/site/content/docs/5.1/components/toasts.md index d17d8b3df..449f0275c 100644 --- a/site/content/docs/5.1/components/toasts.md +++ b/site/content/docs/5.1/components/toasts.md @@ -424,7 +424,7 @@ var myToast = bootstrap.Toast.getInstance(myToastEl) // Returns a Bootstrap toas #### getOrCreateInstance -*Static* method which allows you to get the toast instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the toast instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var myToastEl = document.getElementById('myToastEl') diff --git a/site/content/docs/5.1/components/tooltips.md b/site/content/docs/5.1/components/tooltips.md index 59d2480d4..58da2076b 100644 --- a/site/content/docs/5.1/components/tooltips.md +++ b/site/content/docs/5.1/components/tooltips.md @@ -419,7 +419,7 @@ var tooltip = bootstrap.Tooltip.getInstance(exampleTriggerEl) // Returns a Boots #### getOrCreateInstance -*Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialised +*Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialized ```js var exampleTriggerEl = document.getElementById('example') diff --git a/site/content/docs/5.1/content/reboot.md b/site/content/docs/5.1/content/reboot.md index 73286c21e..f726a6635 100644 --- a/site/content/docs/5.1/content/reboot.md +++ b/site/content/docs/5.1/content/reboot.md @@ -18,6 +18,12 @@ Here are our guidelines and reasons for choosing what to override in Reboot: - For easier scaling across device sizes, block elements should use `rem`s for `margin`s. - Keep declarations of `font`-related properties to a minimum, using `inherit` whenever possible. +## CSS variables + +<small class="d-inline-flex px-2 py-1 font-monospace text-muted border rounded-3">Added in v5.1.1</small> + +With v5.1.1, we standardized our required `@import`s across all our CSS bundles (including `bootstrap.css`, `bootstrap-reboot.css`, and `bootstrap-grid.css` to include `_root.scss` . This adds `:root` level CSS variables to all bundles, regardless of how many of them are used in that bundle. Ultimately Bootstrap 5 will continue to see more CSS variables added over time. + ## Page defaults The `<html>` and `<body>` elements are updated to provide better page-wide defaults. More specifically: diff --git a/site/content/docs/5.1/content/tables.md b/site/content/docs/5.1/content/tables.md index 7ec00201b..6f6e025dc 100644 --- a/site/content/docs/5.1/content/tables.md +++ b/site/content/docs/5.1/content/tables.md @@ -559,7 +559,7 @@ A `<caption>` functions like a heading for a table. It helps users with screen r <div class="bd-example"> <table class="table"> <caption>List of users</caption> - {{< partial "table-content.html" >}} + {{< partial "table-content" >}} </table> </div> diff --git a/site/content/docs/5.1/customize/optimize.md b/site/content/docs/5.1/customize/optimize.md index 29b152154..2fc1bb3fc 100644 --- a/site/content/docs/5.1/customize/optimize.md +++ b/site/content/docs/5.1/customize/optimize.md @@ -71,7 +71,7 @@ Lastly, this [CSS Tricks article on unused CSS](https://css-tricks.com/how-do-yo Whenever possible, be sure to compress all the code you serve to your visitors. If you're using Bootstrap dist files, try to stick to the minified versions (indicated by the `.min.css` and `.min.js` extensions). If you're building Bootstrap from the source with your own build system, be sure to implement your own minifiers for HTML, CSS, and JS. -## Nonblocking files +## Non-blocking files While minifying and using compression might seem like enough, making your files nonblocking ones is also a big step in making your site well-optimized and fast enough. diff --git a/site/content/docs/5.1/customize/options.md b/site/content/docs/5.1/customize/options.md index 0d846270b..c819e6e84 100644 --- a/site/content/docs/5.1/customize/options.md +++ b/site/content/docs/5.1/customize/options.md @@ -26,4 +26,5 @@ You can find and customize these variables for key global options in Bootstrap's | `$enable-negative-margins` | `true` or `false` (default) | Enables the generation of [negative margin utilities]({{< docsref "/utilities/spacing#negative-margin" >}}). | | `$enable-deprecation-messages` | `true` (default) or `false` | Set to `false` to hide warnings when using any of the deprecated mixins and functions that are planned to be removed in `v6`. | | `$enable-important-utilities` | `true` (default) or `false` | Enables the `!important` suffix in utility classes. | +| `$enable-smooth-scroll` | `true` (default) or `false` | Applies `scroll-behavior: smooth` globally, except for users asking for reduced motion through [`prefers-reduced-motion` media query]({{< docsref "/getting-started/accessibility#reduced-motion" >}}) | {{< /bs-table >}} diff --git a/site/content/docs/5.1/customize/sass.md b/site/content/docs/5.1/customize/sass.md index 137f1cfd8..e00d1eeae 100644 --- a/site/content/docs/5.1/customize/sass.md +++ b/site/content/docs/5.1/customize/sass.md @@ -71,7 +71,7 @@ In your `custom.scss`, you'll import Bootstrap's source Sass files. You have two @import "../node_modules/bootstrap/scss/grid"; @import "../node_modules/bootstrap/scss/helpers"; -// 5. Optionally include utilities API last to generate classes based on the Sass map in `_utililies.scss` +// 5. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss` @import "../node_modules/bootstrap/scss/utilities/api"; // 6. Add additional custom code here diff --git a/site/content/docs/5.1/examples/blog-rtl/index.html b/site/content/docs/5.1/examples/blog-rtl/index.html index d3b732c64..3ce0978f3 100644 --- a/site/content/docs/5.1/examples/blog-rtl/index.html +++ b/site/content/docs/5.1/examples/blog-rtl/index.html @@ -154,7 +154,7 @@ include_js: false <nav class="blog-pagination" aria-label="Pagination"> <a class="btn btn-outline-primary" href="#">تدوينات أقدم</a> - <a class="btn btn-outline-secondary disabled" href="#" tabindex="-1" aria-disabled="true">تدوينات أحدث</a> + <a class="btn btn-outline-secondary disabled">تدوينات أحدث</a> </nav> </div> diff --git a/site/content/docs/5.1/examples/blog/index.html b/site/content/docs/5.1/examples/blog/index.html index 13c013b2c..fb5c25dfc 100644 --- a/site/content/docs/5.1/examples/blog/index.html +++ b/site/content/docs/5.1/examples/blog/index.html @@ -115,7 +115,7 @@ include_js: false <li>Second list item with a longer description</li> <li>Third list item to close it out</li> </ol> - <p>And this is a definiton list:</p> + <p>And this is a definition list:</p> <dl> <dt>HyperText Markup Language (HTML)</dt> <dd>The language used to describe and define the content of a Web page</dd> @@ -206,7 +206,7 @@ include_js: false <nav class="blog-pagination" aria-label="Pagination"> <a class="btn btn-outline-primary" href="#">Older</a> - <a class="btn btn-outline-secondary disabled" href="#" tabindex="-1" aria-disabled="true">Newer</a> + <a class="btn btn-outline-secondary disabled">Newer</a> </nav> </div> diff --git a/site/content/docs/5.1/examples/carousel-rtl/index.html b/site/content/docs/5.1/examples/carousel-rtl/index.html index 4e0285686..043d4b063 100644 --- a/site/content/docs/5.1/examples/carousel-rtl/index.html +++ b/site/content/docs/5.1/examples/carousel-rtl/index.html @@ -22,7 +22,7 @@ extra_css: <a class="nav-link" href="#">حلقة الوصل</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">رابط غير مفعل</a> + <a class="nav-link disabled">رابط غير مفعل</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/examples/carousel/index.html b/site/content/docs/5.1/examples/carousel/index.html index da5f3ab7a..8faf6cdd1 100644 --- a/site/content/docs/5.1/examples/carousel/index.html +++ b/site/content/docs/5.1/examples/carousel/index.html @@ -21,7 +21,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/examples/cheatsheet-rtl/index.html b/site/content/docs/5.1/examples/cheatsheet-rtl/index.html index b83e41dd6..d38f17c2e 100644 --- a/site/content/docs/5.1/examples/cheatsheet-rtl/index.html +++ b/site/content/docs/5.1/examples/cheatsheet-rtl/index.html @@ -1157,7 +1157,7 @@ direction: rtl <a class="nav-link active" aria-current="page" href="#">نشط</a> <a class="nav-link" href="#">رابط</a> <a class="nav-link" href="#">رابط</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">معطل</a> + <a class="nav-link disabled">معطل</a> </nav> {{< /example >}} @@ -1194,7 +1194,7 @@ direction: rtl <a class="nav-link" href="#">رابط</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">معطل</a> + <a class="nav-link disabled">معطل</a> </li> </ul> {{< /example >}} @@ -1237,7 +1237,7 @@ direction: rtl </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">معطل</a> + <a class="nav-link disabled">معطل</a> </li> </ul> <form class="d-flex"> @@ -1276,7 +1276,7 @@ direction: rtl </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">معطل</a> + <a class="nav-link disabled">معطل</a> </li> </ul> <form class="d-flex"> @@ -1332,7 +1332,7 @@ direction: rtl <nav aria-label="مثال آخر لترقيم الصفحات"> <ul class="pagination pagination-lg flex-wrap"> <li class="page-item disabled"> - <a class="page-link" href="#" tabindex="-1" aria-disabled="true">السابق</a> + <a class="page-link">السابق</a> </li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"> diff --git a/site/content/docs/5.1/examples/cheatsheet/index.html b/site/content/docs/5.1/examples/cheatsheet/index.html index 1df5ca792..29e8bf639 100644 --- a/site/content/docs/5.1/examples/cheatsheet/index.html +++ b/site/content/docs/5.1/examples/cheatsheet/index.html @@ -1156,7 +1156,7 @@ body_class: "bg-light" <a class="nav-link active" aria-current="page" href="#">Active</a> <a class="nav-link" href="#">Link</a> <a class="nav-link" href="#">Link</a> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </nav> {{< /example >}} @@ -1193,7 +1193,7 @@ body_class: "bg-light" <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> {{< /example >}} @@ -1236,7 +1236,7 @@ body_class: "bg-light" </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> @@ -1275,7 +1275,7 @@ body_class: "bg-light" </ul> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> @@ -1331,7 +1331,7 @@ body_class: "bg-light" <nav aria-label="Another pagination example"> <ul class="pagination pagination-lg flex-wrap"> <li class="page-item disabled"> - <a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a> + <a class="page-link">Previous</a> </li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"> @@ -1560,7 +1560,7 @@ body_class: "bg-light" <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> - <p>This is some placeholder content to show the scrolling behavior for modals. We use repeated line breaks to demonstrate how content can exceed minimum inner height, thereby showing inner scrolling. When content becomes longer than the prefedined max-height of modal, content will be cropped and scrollable within the modal.</p> + <p>This is some placeholder content to show the scrolling behavior for modals. We use repeated line breaks to demonstrate how content can exceed minimum inner height, thereby showing inner scrolling. When content becomes longer than the predefined max-height of modal, content will be cropped and scrollable within the modal.</p> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <p>This content should appear at the bottom after you scroll.</p> </div> diff --git a/site/content/docs/5.1/examples/navbar-bottom/index.html b/site/content/docs/5.1/examples/navbar-bottom/index.html index aee772e20..1a6399975 100644 --- a/site/content/docs/5.1/examples/navbar-bottom/index.html +++ b/site/content/docs/5.1/examples/navbar-bottom/index.html @@ -25,7 +25,7 @@ title: Bottom navbar example <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> diff --git a/site/content/docs/5.1/examples/navbar-fixed/index.html b/site/content/docs/5.1/examples/navbar-fixed/index.html index 848137eff..0c981392e 100644 --- a/site/content/docs/5.1/examples/navbar-fixed/index.html +++ b/site/content/docs/5.1/examples/navbar-fixed/index.html @@ -20,7 +20,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/examples/navbar-static/index.html b/site/content/docs/5.1/examples/navbar-static/index.html index fe95dab47..63c54c9f2 100644 --- a/site/content/docs/5.1/examples/navbar-static/index.html +++ b/site/content/docs/5.1/examples/navbar-static/index.html @@ -20,7 +20,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/examples/navbars/index.html b/site/content/docs/5.1/examples/navbars/index.html index 38281f3dd..04d6ab623 100644 --- a/site/content/docs/5.1/examples/navbars/index.html +++ b/site/content/docs/5.1/examples/navbars/index.html @@ -22,7 +22,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -79,7 +79,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -113,7 +113,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -147,7 +147,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -181,7 +181,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -215,7 +215,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -249,7 +249,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -283,7 +283,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -320,7 +320,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -352,7 +352,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> @@ -385,7 +385,7 @@ extra_css: <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <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> diff --git a/site/content/docs/5.1/examples/sticky-footer-navbar/index.html b/site/content/docs/5.1/examples/sticky-footer-navbar/index.html index ce036dc09..cd72aa778 100644 --- a/site/content/docs/5.1/examples/sticky-footer-navbar/index.html +++ b/site/content/docs/5.1/examples/sticky-footer-navbar/index.html @@ -24,7 +24,7 @@ body_class: "d-flex flex-column h-100" <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> + <a class="nav-link disabled">Disabled</a> </li> </ul> <form class="d-flex"> diff --git a/site/content/docs/5.1/forms/checks-radios.md b/site/content/docs/5.1/forms/checks-radios.md index 0f5507f54..efd040de0 100644 --- a/site/content/docs/5.1/forms/checks-radios.md +++ b/site/content/docs/5.1/forms/checks-radios.md @@ -102,23 +102,23 @@ Add the `disabled` attribute and the associated `<label>`s are automatically sty ## Switches -A switch has the markup of a custom checkbox but uses the `.form-switch` class to render a toggle switch. Switches also support the `disabled` attribute. +A switch has the markup of a custom checkbox but uses the `.form-switch` class to render a toggle switch. Consider using `role="switch"` to more accurately convey the nature of the control to assistive technologies that support this role. In older assistive technologies, it will simply be announced as a regular checkbox as a fallback. Switches also support the `disabled` attribute. {{< example >}} <div class="form-check form-switch"> - <input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault"> + <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault"> <label class="form-check-label" for="flexSwitchCheckDefault">Default switch checkbox input</label> </div> <div class="form-check form-switch"> - <input class="form-check-input" type="checkbox" id="flexSwitchCheckChecked" checked> + <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked" checked> <label class="form-check-label" for="flexSwitchCheckChecked">Checked switch checkbox input</label> </div> <div class="form-check form-switch"> - <input class="form-check-input" type="checkbox" id="flexSwitchCheckDisabled" disabled> + <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDisabled" disabled> <label class="form-check-label" for="flexSwitchCheckDisabled">Disabled switch checkbox input</label> </div> <div class="form-check form-switch"> - <input class="form-check-input" type="checkbox" id="flexSwitchCheckCheckedDisabled" checked disabled> + <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckCheckedDisabled" checked disabled> <label class="form-check-label" for="flexSwitchCheckCheckedDisabled">Disabled checked switch checkbox input</label> </div> {{< /example >}} diff --git a/site/content/docs/5.1/forms/validation.md b/site/content/docs/5.1/forms/validation.md index 81f8b73d2..c4bc1b5db 100644 --- a/site/content/docs/5.1/forms/validation.md +++ b/site/content/docs/5.1/forms/validation.md @@ -103,7 +103,7 @@ Custom feedback styles apply custom colors, borders, focus styles, and backgroun {{< example lang="js" show_preview="false" >}} {{< js.inline >}} -{{- readFile (printf "site/static/docs/%s/assets/js/validate-forms.js" .Site.Params.docs_version) -}} +{{- readFile (path.Join "site/static/docs" .Site.Params.docs_version "assets/js/validate-forms.js") -}} {{< /js.inline >}} {{< /example >}} diff --git a/site/content/docs/5.1/getting-started/rfs.md b/site/content/docs/5.1/getting-started/rfs.md index f440924d1..5aa6840a4 100644 --- a/site/content/docs/5.1/getting-started/rfs.md +++ b/site/content/docs/5.1/getting-started/rfs.md @@ -8,13 +8,13 @@ toc: true ## What is RFS? -Bootstrap's side project [RFS](https://github.com/twbs/rfs/tree/v{{< param "rfs_version" >}}) is a unit resizing engine which was initially developed to resize font sizes (hence its abbreviation for Responsive Font Sizes). Nowadays RFS is capable of rescaling most CSS properties with unit values like `margin`, `padding`, `border-radius`, or even `box-shadow`. +Bootstrap's side project [RFS](https://github.com/twbs/rfs/tree/{{< param "rfs_version" >}}) is a unit resizing engine which was initially developed to resize font sizes (hence its abbreviation for Responsive Font Sizes). Nowadays RFS is capable of rescaling most CSS properties with unit values like `margin`, `padding`, `border-radius`, or even `box-shadow`. The mechanism automatically calculates the appropriate values based on the dimensions of the browser viewport. It will be compiled into `calc()` functions with a mix of `rem` and viewport units to enable the responsive scaling behavior. ## Using RFS -The mixins are included in Bootstrap and are available once you include Bootstrap's `scss`. RFS can also be [installed standalone](https://github.com/twbs/rfs/tree/v{{< param "rfs_version" >}}#installation) if needed. +The mixins are included in Bootstrap and are available once you include Bootstrap's `scss`. RFS can also be [installed standalone](https://github.com/twbs/rfs/tree/{{< param "rfs_version" >}}#installation) if needed. ### Using the mixins @@ -83,4 +83,4 @@ In this example, we use one of Bootstrap's built-in [responsive breakpoint mixin ## Extended documentation -RFS is a separate project under the Bootstrap organization. More about RFS and its configuration can be found on its [GitHub repository](https://github.com/twbs/rfs/tree/v{{< param "rfs_version" >}}). +RFS is a separate project under the Bootstrap organization. More about RFS and its configuration can be found on its [GitHub repository](https://github.com/twbs/rfs/tree/{{< param "rfs_version" >}}). diff --git a/site/content/docs/5.1/getting-started/webpack.md b/site/content/docs/5.1/getting-started/webpack.md index 6998e1e99..b87460ebe 100644 --- a/site/content/docs/5.1/getting-started/webpack.md +++ b/site/content/docs/5.1/getting-started/webpack.md @@ -15,15 +15,19 @@ toc: true Import [Bootstrap's JavaScript]({{< docsref "/getting-started/javascript" >}}) by adding this line to your app's entry point (usually `index.js` or `app.js`): ```js -// You can specify which plugins you need -import { Tooltip, Toast, Popover } from 'bootstrap'; +import 'bootstrap'; + +// or get all of the named exports for further usage +import * as bootstrap from 'bootstrap'; ``` Alternatively, if you only need just a few of our plugins, you may **import plugins individually** as needed: ```js import Alert from 'bootstrap/js/dist/alert'; -... + +// or, specify which plugins you need: +import { Tooltip, Toast, Popover } from 'bootstrap'; ``` Bootstrap depends on [Popper](https://popper.js.org/), which is specified in the `peerDependencies` property. diff --git a/site/content/docs/5.1/helpers/stacks.md b/site/content/docs/5.1/helpers/stacks.md index a93a80046..20ca86aa0 100644 --- a/site/content/docs/5.1/helpers/stacks.md +++ b/site/content/docs/5.1/helpers/stacks.md @@ -8,6 +8,10 @@ toc: true Stacks offer a shortcut for applying a number of flexbox properties to quickly and easily create layouts in Bootstrap. All credit for the concept and implementation goes to the open source [Pylon project](https://almonk.github.io/pylon/). +{{< callout warning >}} +Heads up! Support for gap utilities with flexbox was recently added to Safari, so consider verifying your intended browser support. Grid layout should have no issues. [Read more](https://caniuse.com/flexbox-gap). +{{< /callout >}} + ## Vertical Use `.vstack` to create vertical layouts. Stacked items are full-width by default. Use `.gap-*` utilities to add space between items. @@ -68,7 +72,7 @@ Create an inline form with `.hstack`: {{< example >}} <div class="hstack gap-3"> - <input class="form-control me-auto" type="text" placeholder="Add your item here..."> + <input class="form-control me-auto" type="text" placeholder="Add your item here..." aria-label="Add your item here..."> <button type="button" class="btn btn-secondary">Submit</button> <div class="vr"></div> <button type="button" class="btn btn-outline-danger">Reset</button> diff --git a/site/content/docs/5.1/helpers/text-truncation.md b/site/content/docs/5.1/helpers/text-truncation.md index a92a171fd..799f2059b 100644 --- a/site/content/docs/5.1/helpers/text-truncation.md +++ b/site/content/docs/5.1/helpers/text-truncation.md @@ -12,12 +12,12 @@ For longer content, you can add a `.text-truncate` class to truncate the text wi <!-- Block level --> <div class="row"> <div class="col-2 text-truncate"> - Praeterea iter est quasdam res quas ex communi. + This text is quite long, and will be truncated once displayed. </div> </div> <!-- Inline level --> <span class="d-inline-block text-truncate" style="max-width: 150px;"> - Praeterea iter est quasdam res quas ex communi. + This text is quite long, and will be truncated once displayed. </span> {{< /example >}} diff --git a/site/content/docs/5.1/layout/css-grid.md b/site/content/docs/5.1/layout/css-grid.md index 424167839..c3a1831c1 100644 --- a/site/content/docs/5.1/layout/css-grid.md +++ b/site/content/docs/5.1/layout/css-grid.md @@ -9,7 +9,7 @@ toc: true Bootstrap's default grid system represents the culmination of over a decade of CSS layout techniques, tried and tested by millions of people. But, it was also created without many of the modern CSS features and techniques we're seeing in browsers like the new CSS Grid. {{< callout warning >}} -**Heads up—our CSS Grid system is experimental and opt-in for v5.1.0!** We included it in our documentation's CSS to demonstrate it for you, but it's disabled by default. Keep reading to learn how to enable it in your projects. +**Heads up—our CSS Grid system is experimental and opt-in as of v5.1.0!** We included it in our documentation's CSS to demonstrate it for you, but it's disabled by default. Keep reading to learn how to enable it in your projects. {{< /callout >}} ## How it works diff --git a/site/content/docs/5.1/utilities/interactions.md b/site/content/docs/5.1/utilities/interactions.md index b95b98a10..35ea2b995 100644 --- a/site/content/docs/5.1/utilities/interactions.md +++ b/site/content/docs/5.1/utilities/interactions.md @@ -26,9 +26,12 @@ Bootstrap provides `.pe-none` and `.pe-auto` classes to prevent or add element i <p class="pe-none"><a href="#" tabindex="-1" aria-disabled="true">This link</a> can not be clicked because the <code>pointer-events</code> property is inherited from its parent. However, <a href="#" class="pe-auto">this link</a> has a <code>pe-auto</code> class and can be clicked.</p> {{< /example >}} -{{< callout warning >}} -The `.pe-none` class (and the `pointer-events` CSS property it sets) only prevents interactions with a pointer (mouse, stylus, touch). Links and controls with `.pe-none` are, by default, still focusable and actionable for keyboard users. To ensure that they are completely neutralized even for keyboard users, you may need to add further attributes such as `tabindex="-1"` (to prevent them from receiving keyboard focus) and `aria-disabled="true"` (to convey the fact they are effectively disabled to assistive technologies), and possibly use JavaScript to completely prevent them from being actionable. For form controls, consider using the `disabled` HTML attribute instead. -{{< /callout >}} +The `.pe-none` class (and the `pointer-events` CSS property it sets) only prevents interactions with a pointer (mouse, stylus, touch). Links and controls with `.pe-none` are, by default, still focusable and actionable for keyboard users. To ensure that they are completely neutralized even for keyboard users, you may need to add further attributes such as `tabindex="-1"` (to prevent them from receiving keyboard focus) and `aria-disabled="true"` (to convey the fact they are effectively disabled to assistive technologies), and possibly use JavaScript to completely prevent them from being actionable. + +If possible, the simpler solution is: + +- For form controls, add the `disabled` HTML attribute. +* For links, remove the `href` attribute, making it a non-interactive anchor or placeholder link. ## Sass |
