From 2c7f888c1ec667119c6a811ed247aaa3cd539fed Mon Sep 17 00:00:00 2001 From: ZhangChengLin <469946668@qq.com> Date: Mon, 5 Jun 2023 23:02:46 +0800 Subject: [PATCH] add a base class style display for toggle buttons --- site/content/docs/5.3/components/buttons.md | 26 ++++++++++++++---- site/content/docs/5.3/forms/checks-radios.md | 29 +++++++++++++++++--- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index da380c144c..83a61382a3 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 + + {{< /example >}} ### Methods diff --git a/site/content/docs/5.3/forms/checks-radios.md b/site/content/docs/5.3/forms/checks-radios.md index 13a5091ad6..a18ab38c2b 100644 --- a/site/content/docs/5.3/forms/checks-radios.md +++ b/site/content/docs/5.3/forms/checks-radios.md @@ -250,18 +250,25 @@ Create button-like checkboxes and radio buttons by using `.btn` styles rather th {{< example >}} -{{< /example >}} -{{< example >}} -{{< /example >}} -{{< example >}} {{< /example >}} +{{< example >}} + + + + + + + + +{{< /example >}} + {{< callout info >}} Visually, these checkbox toggle buttons are identical to the [button plugin toggle buttons]({{< docsref "/components/buttons#button-plugin" >}}). However, they are conveyed differently by assistive technologies: the checkbox toggles will be announced by screen readers as "checked"/"not checked" (since, despite their appearance, they are fundamentally still checkboxes), whereas the button plugin toggle buttons will be announced as "button"/"button pressed". The choice between these two approaches will depend on the type of toggle you are creating, and whether or not the toggle will make sense to users when announced as a checkbox or as an actual button. {{< /callout >}} @@ -282,6 +289,20 @@ Visually, these checkbox toggle buttons are identical to the [button plugin togg {{< /example >}} +{{< example >}} + + + + + + + + + + + +{{< /example >}} + ### Outlined styles Different variants of `.btn`, such at the various outlined styles, are supported. -- 2.47.3