From c1d5a801b4bc66e3866f815be00e11d1b20d3539 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 24 Jun 2023 14:44:36 +0200 Subject: Adding upstream version 5.3.0+dfsg. Signed-off-by: Daniel Baumann --- site/content/docs/5.2/components/accordion.md | 165 ---- site/content/docs/5.2/components/alerts.md | 257 ----- site/content/docs/5.2/components/badge.md | 103 -- site/content/docs/5.2/components/breadcrumb.md | 111 --- site/content/docs/5.2/components/button-group.md | 256 ----- site/content/docs/5.2/components/buttons.md | 242 ----- site/content/docs/5.2/components/card.md | 739 -------------- site/content/docs/5.2/components/carousel.md | 385 -------- site/content/docs/5.2/components/close-button.md | 38 - site/content/docs/5.2/components/collapse.md | 198 ---- site/content/docs/5.2/components/dropdowns.md | 1124 ---------------------- site/content/docs/5.2/components/list-group.md | 494 ---------- site/content/docs/5.2/components/modal.md | 888 ----------------- site/content/docs/5.2/components/navbar.md | 813 ---------------- site/content/docs/5.2/components/navs-tabs.md | 671 ------------- site/content/docs/5.2/components/offcanvas.md | 353 ------- site/content/docs/5.2/components/pagination.md | 177 ---- site/content/docs/5.2/components/placeholders.md | 145 --- site/content/docs/5.2/components/popovers.md | 284 ------ site/content/docs/5.2/components/progress.md | 154 --- site/content/docs/5.2/components/scrollspy.md | 427 -------- site/content/docs/5.2/components/spinners.md | 213 ---- site/content/docs/5.2/components/toasts.md | 401 -------- site/content/docs/5.2/components/tooltips.md | 301 ------ 24 files changed, 8939 deletions(-) delete mode 100644 site/content/docs/5.2/components/accordion.md delete mode 100644 site/content/docs/5.2/components/alerts.md delete mode 100644 site/content/docs/5.2/components/badge.md delete mode 100644 site/content/docs/5.2/components/breadcrumb.md delete mode 100644 site/content/docs/5.2/components/button-group.md delete mode 100644 site/content/docs/5.2/components/buttons.md delete mode 100644 site/content/docs/5.2/components/card.md delete mode 100644 site/content/docs/5.2/components/carousel.md delete mode 100644 site/content/docs/5.2/components/close-button.md delete mode 100644 site/content/docs/5.2/components/collapse.md delete mode 100644 site/content/docs/5.2/components/dropdowns.md delete mode 100644 site/content/docs/5.2/components/list-group.md delete mode 100644 site/content/docs/5.2/components/modal.md delete mode 100644 site/content/docs/5.2/components/navbar.md delete mode 100644 site/content/docs/5.2/components/navs-tabs.md delete mode 100644 site/content/docs/5.2/components/offcanvas.md delete mode 100644 site/content/docs/5.2/components/pagination.md delete mode 100644 site/content/docs/5.2/components/placeholders.md delete mode 100644 site/content/docs/5.2/components/popovers.md delete mode 100644 site/content/docs/5.2/components/progress.md delete mode 100644 site/content/docs/5.2/components/scrollspy.md delete mode 100644 site/content/docs/5.2/components/spinners.md delete mode 100644 site/content/docs/5.2/components/toasts.md delete mode 100644 site/content/docs/5.2/components/tooltips.md (limited to 'site/content/docs/5.2/components') diff --git a/site/content/docs/5.2/components/accordion.md b/site/content/docs/5.2/components/accordion.md deleted file mode 100644 index 2e24723..0000000 --- a/site/content/docs/5.2/components/accordion.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -layout: docs -title: Accordion -description: Build vertically collapsing accordions in combination with our Collapse JavaScript plugin. -group: components -aliases: - - "/components/" - - "/docs/5.2/components/" -toc: true ---- - -## How it works - -The accordion uses [collapse]({{< docsref "/components/collapse" >}}) internally to make it collapsible. To render an accordion that's expanded, add the `.open` class on the `.accordion`. - -{{< callout info >}} -{{< partial "callout-info-prefersreducedmotion.md" >}} -{{< /callout >}} - -## Example - -Click the accordions below to expand/collapse the accordion content. - -{{< example >}} -
-
-

- -

-
-
- This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-

- -

-
-
- This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-

- -

-
-
- This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-{{< /example >}} - -### Flush - -Add `.accordion-flush` to remove the default `background-color`, some borders, and some rounded corners to render accordions edge-to-edge with their parent container. - -{{< example class="bg-light" >}} -
-
-

- -

-
-
Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the first item's accordion body.
-
-
-
-

- -

-
-
Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the second item's accordion body. Let's imagine this being filled with some actual content.
-
-
-
-

- -

-
-
Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.
-
-
-
-{{< /example >}} - -### Always open - -Omit the `data-bs-parent` attribute on each `.accordion-collapse` to make accordion items stay open when another item is opened. - -{{< example >}} -
-
-

- -

-
-
- This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-

- -

-
-
- This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-

- -

-
-
- This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-{{< /example >}} - -## Accessibility - -Please read the [collapse accessibility section]({{< docsref "/components/collapse#accessibility" >}}) for more information. - -## CSS - -### Variables - -{{< added-in "5.2.0" >}} - -As part of Bootstrap's evolving CSS variables approach, accordions now use local CSS variables on `.accordion` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. - -{{< scss-docs name="accordion-css-vars" file="scss/_accordion.scss" >}} - -### Sass variables - -{{< scss-docs name="accordion-variables" file="scss/_variables.scss" >}} diff --git a/site/content/docs/5.2/components/alerts.md b/site/content/docs/5.2/components/alerts.md deleted file mode 100644 index 8837ed4..0000000 --- a/site/content/docs/5.2/components/alerts.md +++ /dev/null @@ -1,257 +0,0 @@ ---- -layout: docs -title: Alerts -description: Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. -group: components -toc: true ---- - -## Examples - -Alerts are available for any length of text, as well as an optional close button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts JavaScript plugin](#dismissing). - -{{< example >}} -{{< alerts.inline >}} -{{- range (index $.Site.Data "theme-colors") }} -{{- end -}} -{{< /alerts.inline >}} -{{< /example >}} - -{{< callout info >}} -{{< partial "callout-warning-color-assistive-technologies.md" >}} -{{< /callout >}} - -### Live example - -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 stackblitz_add_js="true" >}} -
- -{{< /example >}} - -We use the following JavaScript to trigger our live alert demo: - -```js -const alertPlaceholder = document.getElementById('liveAlertPlaceholder') - -const alert = (message, type) => { - const wrapper = document.createElement('div') - wrapper.innerHTML = [ - `' - ].join('') - - alertPlaceholder.append(wrapper) -} - -const alertTrigger = document.getElementById('liveAlertBtn') -if (alertTrigger) { - alertTrigger.addEventListener('click', () => { - alert('Nice, you triggered this alert message!', 'success') - }) -} -``` - -### Link color - -Use the `.alert-link` utility class to quickly provide matching colored links within any alert. - -{{< example >}} -{{< alerts.inline >}} -{{- range (index $.Site.Data "theme-colors") }} -{{ end -}} -{{< /alerts.inline >}} -{{< /example >}} - -### Additional content - -Alerts can also contain additional HTML elements like headings, paragraphs and dividers. - -{{< example >}} - -{{< /example >}} - -### Icons - -Similarly, you can use [flexbox utilities]({{< docsref "/utilities/flex" >}}) and [Bootstrap Icons]({{< param icons >}}) to create alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles. - -{{< example >}} - -{{< /example >}} - -Need more than one icon for your alerts? Consider using more Bootstrap Icons and making a local SVG sprite like so to easily reference the same icons repeatedly. - -{{< example >}} - - - - - - - - - - - - - - - - -{{< /example >}} - -### Dismissing - -Using the alert JavaScript plugin, it's possible to dismiss any alert inline. Here's how: - -- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript. -- Add a [close button]({{< docsref "/components/close-button" >}}) and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the close button. -- On the close button, add the `data-bs-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the ` - -{{< /example >}} - -{{< callout warning >}} -When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document. For this reason, we recommend including additional JavaScript that listens for the `closed.bs.alert` event and programmatically sets `focus()` to the most appropriate location in the page. If you're planning to move focus to a non-interactive element that normally does not receive focus, make sure to add `tabindex="-1"` to the element. -{{< /callout >}} - -## CSS - -### Variables - -{{< added-in "5.2.0" >}} - -As part of Bootstrap's evolving CSS variables approach, alerts now use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. - -{{< scss-docs name="alert-css-vars" file="scss/_alert.scss" >}} - -### Sass variables - -{{< scss-docs name="alert-variables" file="scss/_variables.scss" >}} - -### Sass mixin - -Used in combination with `$theme-colors` to create contextual modifier classes for our alerts. - -{{< scss-docs name="alert-variant-mixin" file="scss/mixins/_alert.scss" >}} - -### Sass loop - -Loop that generates the modifier classes with the `alert-variant()` mixin. - -{{< scss-docs name="alert-modifiers" file="scss/_alert.scss" >}} - -## JavaScript behavior - -### Initialize - -Initialize elements as alerts - -```js -const alertList = document.querySelectorAll('.alert') -const alerts = [...alertList].map(element => new bootstrap.Alert(element)) -``` - -{{< callout info >}} -For the sole purpose of dismissing an alert, it isn't necessary to initialize the component manually via the JS API. By making use of `data-bs-dismiss="alert"`, the component will be initialized automatically and properly dismissed. - -See the [triggers](#triggers) section for more details. -{{< /callout >}} - -### Triggers - -{{% js-dismiss "alert" %}} - -**Note that closing an alert will remove it from the DOM.** - -### Methods - -You can create an alert instance with the alert constructor, for example: - -```js -const bsAlert = new bootstrap.Alert('#myAlert') -``` - -This makes an alert listen for click events on descendant elements which have the `data-bs-dismiss="alert"` attribute. (Not necessary when using the data-api’s auto-initialization.) - -{{< bs-table >}} -| Method | Description | -| --- | --- | -| `close` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. | -| `dispose` | Destroys an element's alert. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the alert instance associated to a DOM element. For example: `bootstrap.Alert.getInstance(alert)`. | -| `getOrCreateInstance` | 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: `bootstrap.Alert.getOrCreateInstance(element)`. | -{{< /bs-table >}} - -Basic usage: - -```js -const alert = bootstrap.Alert.getOrCreateInstance('#myAlert') -alert.close() -``` - -### Events - -Bootstrap's alert plugin exposes a few events for hooking into alert functionality. - -{{< bs-table >}} -| Event | Description | -| --- | --- | -| `close.bs.alert` | Fires immediately when the `close` instance method is called. | -| `closed.bs.alert` | Fired when the alert has been closed and CSS transitions have completed. | -{{< /bs-table >}} - -```js -const myAlert = document.getElementById('myAlert') -myAlert.addEventListener('closed.bs.alert', event => { - // do something, for instance, explicitly move focus to the most appropriate element, - // so it doesn't get lost/reset to the start of the page - // document.getElementById('...').focus() -}) -``` diff --git a/site/content/docs/5.2/components/badge.md b/site/content/docs/5.2/components/badge.md deleted file mode 100644 index 55b1ffb..0000000 --- a/site/content/docs/5.2/components/badge.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -layout: docs -title: Badges -description: Documentation and examples for badges, our small count and labeling component. -group: components -toc: true ---- - -## Examples - -Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units. As of v5, badges no longer have focus or hover styles for links. - -### Headings - -{{< example >}} -

Example heading New

-

Example heading New

-

Example heading New

-

Example heading New

-
Example heading New
-
Example heading New
-{{< /example >}} - -### Buttons - -Badges can be used as part of links or buttons to provide a counter. - -{{< example >}} - -{{< /example >}} - -Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button. - -Unless the context is clear (as with the "Notifications" example, where it is understood that the "4" is the number of notifications), consider including additional context with a visually hidden piece of additional text. - -### Positioned - -Use utilities to modify a `.badge` and position it in the corner of a link or button. - -{{< example >}} - -{{< /example >}} - -You can also replace the `.badge` class with a few more utilities without a count for a more generic indicator. - -{{< example >}} - -{{< /example >}} - -## Background colors - -{{< added-in "5.2.0" >}} - -Set a `background-color` with contrasting foreground `color` with [our `.text-bg-{color}` helpers]({{< docsref "helpers/color-background" >}}). Previously it was required to manually pair your choice of [`.text-{color}`]({{< docsref "/utilities/colors" >}}) and [`.bg-{color}`]({{< docsref "/utilities/background" >}}) utilities for styling, which you still may use if you prefer. - -{{< example >}} -{{< badge.inline >}} -{{- range (index $.Site.Data "theme-colors") }} -{{ .name | title }}{{- end -}} -{{< /badge.inline >}} -{{< /example >}} - -{{< callout info >}} -{{< partial "callout-warning-color-assistive-technologies.md" >}} -{{< /callout >}} - -## Pill badges - -Use the `.rounded-pill` utility class to make badges more rounded with a larger `border-radius`. - -{{< example >}} -{{< badge.inline >}} -{{- range (index $.Site.Data "theme-colors") }} -{{ .name | title }}{{- end -}} -{{< /badge.inline >}} -{{< /example >}} - -## CSS - -### Variables - -{{< added-in "5.2.0" >}} - -As part of Bootstrap's evolving CSS variables approach, badges now use local CSS variables on `.badge` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. - -{{< scss-docs name="badge-css-vars" file="scss/_badge.scss" >}} - -### Sass variables - -{{< scss-docs name="badge-variables" file="scss/_variables.scss" >}} diff --git a/site/content/docs/5.2/components/breadcrumb.md b/site/content/docs/5.2/components/breadcrumb.md deleted file mode 100644 index 0012f97..0000000 --- a/site/content/docs/5.2/components/breadcrumb.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -layout: docs -title: Breadcrumb -description: Indicate the current page's location within a navigational hierarchy that automatically adds separators via CSS. -group: components -toc: true ---- - -## Example - -Use an ordered or unordered list with linked list items to create a minimally styled breadcrumb. Use our utilities to add additional styles as desired. - -{{< example >}} - - - - - -{{< /example >}} - -## Dividers - -Dividers are automatically added in CSS through [`::before`](https://developer.mozilla.org/en-US/docs/Web/CSS/::before) and [`content`](https://developer.mozilla.org/en-US/docs/Web/CSS/content). They can be changed by modifying a local CSS custom property `--bs-breadcrumb-divider`, or through the `$breadcrumb-divider` Sass variable — and `$breadcrumb-divider-flipped` for its RTL counterpart, if needed. We default to our Sass variable, which is set as a fallback to the custom property. This way, you get a global divider that you can override without recompiling CSS at any time. - -{{< example >}} - -{{< /example >}} - -When modifying via Sass, the [quote](https://sass-lang.com/documentation/modules/string#quote) function is required to generate the quotes around a string. For example, using `>` as the divider, you can use this: - -```scss -$breadcrumb-divider: quote(">"); -``` - -It's also possible to use an **embedded SVG icon**. Apply it via our CSS custom property, or use the Sass variable. - - -{{< callout info >}} -### Using embedded SVG - -Inlining SVG as data URI requires to URL escape a few characters, most notably `<`, `>` and `#`. That's why the `$breadcrumb-divider` variable is passed through our [`escape-svg()` Sass function]({{< docsref "/customize/sass#escape-svg" >}}). When using the CSS custom property, you need to URL escape your SVG on your own. Read [Kevin Weber's explanations on CodePen](https://codepen.io/kevinweber/pen/dXWoRw ) for detailed information on what to escape. -{{< /callout >}} - -{{< example >}} - -{{< /example >}} - -```scss -$breadcrumb-divider: url("data:image/svg+xml,"); -``` - -You can also remove the divider setting `--bs-breadcrumb-divider: '';` (empty strings in CSS custom properties counts as a value), or setting the Sass variable to `$breadcrumb-divider: none;`. - -{{< example >}} - -{{< /example >}} - - -```scss -$breadcrumb-divider: none; -``` - -## Accessibility - -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 `