From cf9454caa00872899215603e5e036d9a824b1b11 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 24 Dec 2022 18:37:22 +0200 Subject: Release v5.3.0-alpha1 (#37661) * Bump version to 5.3.0-alpha1 * Dist * Add docs versions updates * Update note in homepage hero Co-authored-by: Mark Otto --- site/content/docs/5.3/components/accordion.md | 165 ++++ site/content/docs/5.3/components/alerts.md | 263 +++++ site/content/docs/5.3/components/badge.md | 103 ++ site/content/docs/5.3/components/breadcrumb.md | 111 +++ site/content/docs/5.3/components/button-group.md | 256 +++++ site/content/docs/5.3/components/buttons.md | 242 +++++ site/content/docs/5.3/components/card.md | 739 ++++++++++++++ site/content/docs/5.3/components/carousel.md | 448 +++++++++ site/content/docs/5.3/components/close-button.md | 44 + site/content/docs/5.3/components/collapse.md | 198 ++++ site/content/docs/5.3/components/dropdowns.md | 1134 ++++++++++++++++++++++ site/content/docs/5.3/components/list-group.md | 500 ++++++++++ site/content/docs/5.3/components/modal.md | 888 +++++++++++++++++ site/content/docs/5.3/components/navbar.md | 817 ++++++++++++++++ site/content/docs/5.3/components/navs-tabs.md | 671 +++++++++++++ site/content/docs/5.3/components/offcanvas.md | 353 +++++++ site/content/docs/5.3/components/pagination.md | 177 ++++ site/content/docs/5.3/components/placeholders.md | 145 +++ site/content/docs/5.3/components/popovers.md | 284 ++++++ site/content/docs/5.3/components/progress.md | 169 ++++ site/content/docs/5.3/components/scrollspy.md | 427 ++++++++ site/content/docs/5.3/components/spinners.md | 211 ++++ site/content/docs/5.3/components/toasts.md | 401 ++++++++ site/content/docs/5.3/components/tooltips.md | 301 ++++++ 24 files changed, 9047 insertions(+) create mode 100644 site/content/docs/5.3/components/accordion.md create mode 100644 site/content/docs/5.3/components/alerts.md create mode 100644 site/content/docs/5.3/components/badge.md create mode 100644 site/content/docs/5.3/components/breadcrumb.md create mode 100644 site/content/docs/5.3/components/button-group.md create mode 100644 site/content/docs/5.3/components/buttons.md create mode 100644 site/content/docs/5.3/components/card.md create mode 100644 site/content/docs/5.3/components/carousel.md create mode 100644 site/content/docs/5.3/components/close-button.md create mode 100644 site/content/docs/5.3/components/collapse.md create mode 100644 site/content/docs/5.3/components/dropdowns.md create mode 100644 site/content/docs/5.3/components/list-group.md create mode 100644 site/content/docs/5.3/components/modal.md create mode 100644 site/content/docs/5.3/components/navbar.md create mode 100644 site/content/docs/5.3/components/navs-tabs.md create mode 100644 site/content/docs/5.3/components/offcanvas.md create mode 100644 site/content/docs/5.3/components/pagination.md create mode 100644 site/content/docs/5.3/components/placeholders.md create mode 100644 site/content/docs/5.3/components/popovers.md create mode 100644 site/content/docs/5.3/components/progress.md create mode 100644 site/content/docs/5.3/components/scrollspy.md create mode 100644 site/content/docs/5.3/components/spinners.md create mode 100644 site/content/docs/5.3/components/toasts.md create mode 100644 site/content/docs/5.3/components/tooltips.md (limited to 'site/content/docs/5.3/components') diff --git a/site/content/docs/5.3/components/accordion.md b/site/content/docs/5.3/components/accordion.md new file mode 100644 index 000000000..33399772a --- /dev/null +++ b/site/content/docs/5.3/components/accordion.md @@ -0,0 +1,165 @@ +--- +layout: docs +title: Accordion +description: Build vertically collapsing accordions in combination with our Collapse JavaScript plugin. +group: components +aliases: + - "/components/" + - "/docs/5.3/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 "callouts/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-body-secondary" >}} +
+
+

+ +

+
+
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.3/components/alerts.md b/site/content/docs/5.3/components/alerts.md new file mode 100644 index 000000000..7ea5b9b42 --- /dev/null +++ b/site/content/docs/5.3/components/alerts.md @@ -0,0 +1,263 @@ +--- +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). + +{{< callout info >}} +**Heads up!** As of v5.3.0, the `alert-variant()` Sass mixin is deprecated. Alert variants now have their CSS variables overridden in [the Sass loop](#sass-loop). +{{< /callout >}} + +{{< example >}} +{{< alerts.inline >}} +{{- range (index $.Site.Data "theme-colors") }} +{{- end -}} +{{< /alerts.inline >}} +{{< /example >}} + +{{< callout info >}} +{{< partial "callouts/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 + +{{< deprecated-in "5.3.0" >}} + +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.3/components/badge.md b/site/content/docs/5.3/components/badge.md new file mode 100644 index 000000000..c07387850 --- /dev/null +++ b/site/content/docs/5.3/components/badge.md @@ -0,0 +1,103 @@ +--- +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 "callouts/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.3/components/breadcrumb.md b/site/content/docs/5.3/components/breadcrumb.md new file mode 100644 index 000000000..0012f9748 --- /dev/null +++ b/site/content/docs/5.3/components/breadcrumb.md @@ -0,0 +1,111 @@ +--- +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 ` {{< /example >}} @@ -69,7 +69,7 @@ Centered with `.justify-content-center`: Link {{< /example >}} @@ -88,7 +88,7 @@ Right-aligned with `.justify-content-end`: Link {{< /example >}} @@ -109,7 +109,7 @@ Stack your navigation by changing the flex item direction with the `.flex-column Link {{< /example >}} @@ -121,7 +121,7 @@ As always, vertical navigation is possible without ` {{< /example >}} @@ -162,7 +162,7 @@ Take that same HTML, but use `.nav-pills` instead: Link {{< /example >}} @@ -183,7 +183,7 @@ Take that same HTML, but use `.nav-underline` instead: Link {{< /example >}} @@ -204,7 +204,7 @@ Force your `.nav`'s contents to extend the full available width with one of two Link {{< /example >}} @@ -216,7 +216,7 @@ When using a ` {{< /example >}} @@ -234,7 +234,7 @@ For equal-width elements, use `.nav-justified`. All horizontal space will be occ Link {{< /example >}} @@ -246,7 +246,7 @@ Similar to the `.nav-fill` example using a ` {{< /example >}} @@ -259,7 +259,7 @@ If you need responsive nav variations, consider using a series of [flexbox utili Active Longer nav link Link - Disabled + Disabled {{< /example >}} @@ -294,7 +294,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin Link {{< /example >}} @@ -320,7 +320,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin Link {{< /example >}} diff --git a/site/content/docs/5.3/components/placeholders.md b/site/content/docs/5.3/components/placeholders.md index 3dca3476b..8317b1184 100644 --- a/site/content/docs/5.3/components/placeholders.md +++ b/site/content/docs/5.3/components/placeholders.md @@ -38,7 +38,7 @@ In the example below, we take a typical card component and recreate it with plac

- + @@ -67,7 +67,7 @@ In the example below, we take a typical card component and recreate it with plac

- + ``` @@ -83,7 +83,7 @@ We apply additional styling to `.btn`s via `::before` to ensure the `height` is

- + {{< /example >}} {{< callout info >}} -- cgit v1.2.3 From 6301ca1ee070b1614ff1fd9fc23b0f1bf869475e Mon Sep 17 00:00:00 2001 From: PARTHIBAN Date: Fri, 9 Jun 2023 20:36:26 +0530 Subject: Update buttons.md --- site/content/docs/5.3/components/buttons.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'site/content/docs/5.3/components') diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index ae58fca9a..da380c144 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -129,7 +129,7 @@ To cover cases where you have to keep the `href` attribute on a disabled link, t ## Block buttons -Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button specific classes, we have much greater control over spacing, alignment, and responsive behaviors. +Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button-specific classes, we have much greater control over spacing, alignment, and responsive behaviors. {{< example >}}
@@ -156,7 +156,7 @@ You can adjust the width of your block buttons with grid column width classes. F
{{< /example >}} -Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right align the buttons when they're no longer stacked. +Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right-align the buttons when they're no longer stacked. {{< example >}}
@@ -201,8 +201,8 @@ const bsButton = new bootstrap.Button('#myButton') | Method | Description | | --- | --- | | `dispose` | Destroys an element's button. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the button instance associated to a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. | -| `getOrCreateInstance` | 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: `bootstrap.Button.getOrCreateInstance(element)`. | +| `getInstance` | Static method which allows you to get the button instance associated with a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a button instance associated with a DOM element or creates a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. | | `toggle` | Toggles push state. Gives the button the appearance that it has been activated. | {{< /bs-table >}} @@ -227,7 +227,7 @@ As part of Bootstrap's evolving CSS variables approach, buttons now use local CS Each `.btn-*` modifier class updates the appropriate CSS variables to minimize additional CSS rules with our `button-variant()`, `button-outline-variant()`, and `button-size()` mixins. -Here's an example of building a custom `.btn-*` modifier class like we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables. +Here's an example of building a custom `.btn-*` modifier class as we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables.
-- cgit v1.2.3 From 2c7f888c1ec667119c6a811ed247aaa3cd539fed Mon Sep 17 00:00:00 2001 From: ZhangChengLin <469946668@qq.com> Date: Mon, 5 Jun 2023 23:02:46 +0800 Subject: add a base class style display for toggle buttons --- site/content/docs/5.3/components/buttons.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'site/content/docs/5.3/components') diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index da380c144..83a61382a 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -178,15 +178,29 @@ Visually, these toggle buttons are identical to the [checkbox toggle buttons]({{ Add `data-bs-toggle="button"` to toggle a button's `active` state. If you're pre-toggling a button, you must manually add the `.active` class **and** `aria-pressed="true"` to ensure that it is conveyed appropriately to assistive technologies. {{< example >}} - - - +

+ + + +

+

+ + + +

{{< /example >}} {{< example >}} -Toggle link -Active toggle link -Disabled toggle link +

+ Toggle link + Active toggle link + Disabled toggle link +

+

+ Toggle link + Active toggle link + Disabled toggle link +

{{< /example >}} ### Methods -- cgit v1.2.3 From 8c135169e7ef5a4d6b92b99e21630711d7830963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Sat, 15 Jul 2023 07:45:35 +0200 Subject: Fix tooltip generated markup documentation (#38902) --- site/content/docs/5.3/components/tooltips.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site/content/docs/5.3/components') diff --git a/site/content/docs/5.3/components/tooltips.md b/site/content/docs/5.3/components/tooltips.md index ee98dd058..91adacc7f 100644 --- a/site/content/docs/5.3/components/tooltips.md +++ b/site/content/docs/5.3/components/tooltips.md @@ -165,7 +165,7 @@ The required markup for a tooltip is only a `data` attribute and `title` on the Hover over me -