Skip to content

Commit

Permalink
fix(accordion): update accordion classes following alpha.6, and merge…
Browse files Browse the repository at this point in the history
… boosted specific documentation in bootstrap core documentation
  • Loading branch information
Lausselloic committed Jan 10, 2017
1 parent 7b576c7 commit a151643
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 120 deletions.
16 changes: 8 additions & 8 deletions docs-orange/_includes/boostwatch/accordion.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h2 id="accordion">Accordions<a class="doc-link" href="../components/orange-accordion/" title="go to accordion documentation page"><span class="icon-Forward-curved-arrow"></span></a></h2>
<h2 id="accordion">Accordions<a class="doc-link" href="../components/collapse/#accordion-example" title="go to accordion documentation page"><span class="icon-Forward-curved-arrow"></span></a></h2>

<h3>One at a time</h3>
<div id="accordion-1" role="tablist" class="o-accordion">
<div class="card">
<div class="card-title" role="tab" id="headingOne">
<div class="card-header" role="tab" id="headingOne">
<h5>
<a data-toggle="collapse" data-parent="#accordion-1" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
Expand All @@ -18,7 +18,7 @@ <h5>
</div>
</div>
<div class="card">
<div class="card-title" role="tab" id="headingTwo">
<div class="card-header" role="tab" id="headingTwo">
<h5>
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-1" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
Expand All @@ -32,7 +32,7 @@ <h5>
</div>
</div>
<div class="card">
<div class="card-title" role="tab" id="headingThree">
<div class="card-header" role="tab" id="headingThree">
<h5>
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-1" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
Expand All @@ -48,9 +48,9 @@ <h5>
</div>

<h3 id="accordion2">Multiple openable</h3>
<div id="accordion-2" role="tablist" class="o-accordion">
<div id="accordion-2" role="tablist" aria-multiselectable="true" class="o-accordion">
<div class="card multi">
<div class="card-title" role="tab" id="headingOne-1">
<div class="card-header" role="tab" id="headingOne-1">
<h5>
<a data-toggle="collapse" data-parent="#accordion-2" href="#collapseOne-1" aria-expanded="true" aria-controls="collapseOne-1">
Collapsible Group Item #1
Expand All @@ -65,7 +65,7 @@ <h5>
</div>
</div>
<div class="card multi">
<div class="card-title" role="tab" id="headingTwo-1">
<div class="card-header" role="tab" id="headingTwo-1">
<h5>
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-2" href="#collapseTwo-1" aria-expanded="false" aria-controls="collapseTwo-1">
Collapsible Group Item #2
Expand All @@ -79,7 +79,7 @@ <h5>
</div>
</div>
<div class="card multi">
<div class="card-title" role="tab" id="headingThree-1">
<div class="card-header" role="tab" id="headingThree-1">
<h5>
<a class="collapsed" data-toggle="collapse" data-parent="#accordion-2" href="#collapseThree-1" aria-expanded="false" aria-controls="collapseThree-1">
Collapsible Group Item #3
Expand Down
2 changes: 1 addition & 1 deletion docs-orange/boosted-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ Class names and semantic changed, see [Orange stepbar](../components/orange-step

### Accordions

[Accordions](../components/orange-accordion/) are now based on card structure. Be sure to use `.card-title` and `.card-block` in a `.card` element, in addition of the `.o-accordion` for each card. To get multiple openable behaviour just add `.multi` class on the same level.
[Accordions](../components/collapse/#accordion-example) are now based on card structure. Be sure to use `.card-header` and `.card-block` in a `.card` element, in addition of the `.o-accordion` on the main container. To get multiple openable behaviour just add `.multi` class on each `.card` item.
109 changes: 0 additions & 109 deletions docs-orange/components/orange-accordion.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs-orange/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="bd-featurette-title">All the core components of Bootstrap accessible
<li><a href="components/orange-megamenu/">Main navigation with or without Mega menu</a></li>
<li><a href="components/local-navigation">Local navigation</a></li>
<li><a href="components/orange-stepbar">Stepbar</a></li>
<li><a href="components/orange-accordion">Accordions with indicator</a></li>
<li><a href="components/collapse/#accordion-example">Accordions with indicator</a></li>
<li><a href="components/orange-tables">Complex table</a></li>
<li><a href="content/tables/#responsive-tables">Responsive table, display as cards onto tablets and mobile</a></li>
<li><a href="components/orange-footer/">Footer</a></li>
Expand Down
58 changes: 57 additions & 1 deletion docs/components/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can use a link with the `href` attribute, or a button with the `data-target`
Extend the default collapse behavior to create an accordion.

{% example html %}
<div id="accordion" role="tablist" aria-multiselectable="true" class="o-accordion">
<div id="accordion" role="tablist" class="o-accordion">
<div class="card">
<div class="card-header" role="tab" id="headingOne">
<h5 class="mb-0">
Expand Down Expand Up @@ -90,6 +90,62 @@ Extend the default collapse behavior to create an accordion.
</div>
{% endexample %}

[comment]: # Boosted mod

### Mulitple openable

Simply add the `.multi` class on each panel to get multi openable accordions.

{% example html %}
<div id="accordion-2" role="tablist" aria-multiselectable="true" class="o-accordion">
<div class="card multi">
<div class="card-header" role="tab" id="headingOne-1">
<h5 class="mb-0">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne-1" aria-expanded="true" aria-controls="collapseOne-1">
Collapsible Group Item #1
</a>
</h5>
</div>

<div id="collapseOne-1" class="collapse show" role="tabpanel" aria-labelledby="headingOne-1">
<div class="card-block">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card multi">
<div class="card-header" role="tab" id="headingTwo-1">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo-1" aria-expanded="false" aria-controls="collapseTwo-1">
Collapsible Group Item #2
</a>
</h5>
</div>
<div id="collapseTwo-1" class="collapse" role="tabpanel" aria-labelledby="headingTwo-1">
<div class="card-block">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card multi">
<div class="card-header" role="tab" id="headingThree-1">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree-1" aria-expanded="false" aria-controls="collapseThree-1">
Collapsible Group Item #3
</a>
</h5>
</div>
<div id="collapseThree-1" class="collapse" role="tabpanel" aria-labelledby="headingThree-1">
<div class="card-block">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
{% endexample %}

[comment]: # End mod

## Accessibility

Be sure to add `aria-expanded` to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
Expand Down

0 comments on commit a151643

Please sign in to comment.