Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 79 additions & 19 deletions sample/accordion.dita
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<!--
Within the sample documentation, where necessary, the texts describing the usage of each component have been copied
directly from the official Bootstrap 5.3 documentation (found at https://getbootstrap.com/docs/5.3), however DITA
Expand All @@ -8,6 +7,7 @@
This work is a derivative of "Bootstrap 5.3 docs" by Twitter, Inc. and the Bootstrap Authors,
and used under CC BY 3.0. See the accompanying LICENSE file for applicable licenses.
-->
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="accordion">
<title>Accordion</title>
<shortdesc>Build vertically collapsing accordions in combination with Bootstrap’s Collapse JavaScript
Expand All @@ -20,6 +20,8 @@
<indexterm><xmlatt>outputclass</xmlatt></indexterm>
</indexterm>
<indexterm><xmlelement>bodydiv</xmlelement></indexterm>
<indexterm><xmlelement>accordion</xmlelement></indexterm>
<indexterm><xmlelement>accordion-item</xmlelement></indexterm>
</keywords>
</metadata>
</prolog>
Expand All @@ -32,13 +34,13 @@
format="html"
scope="external"
>collapse</xref> internally to make it collapsible. To render an accordion that’s expanded, add
<xmlatt>outputclass="show"</xmlatt> to expand the relevant <xmlelement>section</xmlelement> .</p>
<xmlatt>open="yes"</xmlatt> to expand the relevant <xmlelement>accordion-item</xmlelement> .</p>
</section>
<section>
<title>Example</title>
<p>Click the accordions below to expand/collapse the accordion content.</p>
</section>
<bodydiv outputclass="bd-example" deliveryTarget="html">
<bodydiv outputclass="p-3 border">
<bodydiv outputclass="accordion">
<section id="accordion1" outputclass="show">
<title>Accordion Item #1</title>
Expand Down Expand Up @@ -66,7 +68,10 @@
</section>
</bodydiv>
</bodydiv>
<codeblock>&lt;bodydiv outputclass="accordion"&gt;
<bodydiv outputclass="nav-pills mt-3">
<section>
<title><xmlatt>outputclass</xmlatt></title>
<codeblock>&lt;bodydiv outputclass="accordion"&gt;
&lt;section id="accordion1" outputclass="show"&gt;
&lt;title&gt;Accordion Item #1&lt;/title&gt;
&lt;p&gt;
Expand Down Expand Up @@ -98,47 +103,91 @@
&lt;/p&gt;
&lt;/section&gt;
&lt;/bodydiv&gt;</codeblock>
</section>
<section>
<title>Specialization</title>
<codeblock>&lt;accordion&gt;
&lt;accordion-item id="accordion1" open="yes"&gt;
&lt;title&gt;Accordion Item #1&lt;/title&gt;
&lt;p&gt;
&lt;b&gt;This is the first item’s accordion body.&lt;/b&gt; 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 Bootstrap’s default
variables.
&lt;/p&gt;
&lt;/accordion-item&gt;
&lt;accordion-item id="accordion2"&gt;
&lt;title&gt;Accordion Item #2&lt;/title&gt;
&lt;p&gt;
&lt;b&gt;This is the second item’s accordion body.&lt;/b&gt; 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 Bootstrap’s default
variables.
&lt;/p&gt;
&lt;/accordion-item&gt;
&lt;accordion-item id="accordion3"&gt;
&lt;title&gt;Accordion Item #3&lt;/title&gt;
&lt;p&gt;
&lt;b&gt;This is the third item’s accordion body.&lt;/b&gt; 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 Bootstrap’s default
variables.
&lt;/p&gt;
&lt;/accordion-item&gt;
&lt;/accordion&gt;</codeblock>
</section>
</bodydiv>
<section>
<title>Flush</title>
<p>Add <xmlatt>outputclass="accordion-flush"</xmlatt> to remove the default
<p>Set <xmlatt>flush="yes"</xmlatt> to remove the default
background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent
container.</p>
</section>
<bodydiv outputclass="bd-example" deliveryTarget="html">
<bodydiv outputclass="p-3 border">
<bodydiv outputclass="accordion-flush">
<section id="accordion4">
<title>Accordion Item #1</title>
<p>
Placeholder content for this accordion, which is intended to demonstrate <xmlatt
>outputclass="accordion-flush"</xmlatt>.
Placeholder content for this accordion, which is intended to demonstrate the use of <xmlatt>flush</xmlatt>
This is the first item's accordion body.</p>
</section>
<section id="accordion5">
<title>Accordion Item #2</title>
<p>Placeholder content for this accordion, which is intended to demonstrate <xmlatt
>outputclass="accordion-flush"</xmlatt>.
<p>Placeholder content for this accordion, which is intended to demonstrate the use of <xmlatt>flush</xmlatt>
This is the second item's accordion body. Let's imagine this being filled with some actual content.</p>
</section>
<section id="accordion6">
<title>Accordion Item #3</title>
<p>
Placeholder content for this accordion, which is intended to demonstrate <xmlatt
>outputclass="accordion-flush"</xmlatt>.
Placeholder content for this accordion, which is intended to demonstrate the use of <xmlatt>flush</xmlatt>
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.</p>
</section>
</bodydiv>
</bodydiv>
<codeblock>&lt;bodydiv outputclass="accordion-flush"&gt;
<bodydiv outputclass="nav-pills mt-3">
<section>
<title><xmlatt>outputclass</xmlatt></title>
<codeblock>&lt;bodydiv outputclass="accordion-flush"&gt;
...etc
&lt;bodydiv&gt;</codeblock>
&lt;/bodydiv&gt;</codeblock>
</section>
<section>
<title>Specialization</title>
<codeblock>&lt;accordion flush="yes"&gt;
...etc
&lt;/accordion&gt;</codeblock>
</section>
</bodydiv>

<section>
<title>Always open</title>
<p>Set <xmlelement
>bodydiv outputclass="accordion-open"</xmlelement> to make accordion items stay open when another item is opened.</p>
<p>Set <xmlatt>open="yes"</xmlatt> to make accordion items stay open when another item is opened.</p>
</section>
<bodydiv outputclass="bd-example" deliveryTarget="html">
<bodydiv outputclass="p-3 border">
<bodydiv outputclass="accordion-open">
<section id="accordion7" outputclass="show">
<title>Accordion Item #1</title>
Expand Down Expand Up @@ -166,8 +215,19 @@
</section>
</bodydiv>
</bodydiv>
<codeblock>&lt;bodydiv outputclass="accordion-open"&gt;
<bodydiv outputclass="nav-pills mt-3">
<section>
<title><xmlatt>outputclass</xmlatt></title>
<codeblock>&lt;bodydiv outputclass="accordion-open"&gt;
...etc
&lt;bodydiv&gt;</codeblock>
&lt;/bodydiv&gt;</codeblock>
</section>
<section>
<title>Specialization</title>
<codeblock>&lt;accordion open="yes"&gt;
...etc
&lt;/accordion&gt;</codeblock>
</section>
</bodydiv>
</body>
</topic>
Loading