mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-08-23 14:02:49 +02:00
Tab module documentation complete
This commit is contained in:
@@ -281,26 +281,64 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-sm-first col-md-8 col-md-normal">
|
||||
<p></p>
|
||||
<p>Apart from the normal tab layout, you can make your tabs stacked instead, using the <code>.stacked</code> class in your <code>.tabs</code> container element. Stacked tabs are more vesatile, allowing you to use checkboxes and/or radio buttons to implement collapses, accordions and spoilers. Carousel-styled elements can also be displayed in this fashion, if you wish. Remember to use the <code><span class="fore-secondary">aria-hidden</span>=<span class="fore-primary">"true"</span></code> attribute to make your tabs fully accessible, as before.</p>
|
||||
<h3>Sample code</h3>
|
||||
<pre></pre>
|
||||
<pre><div class="tabs stacked">
|
||||
<input type="radio" name="accordion" id="a1" checked aria-hidden="true">
|
||||
<label for="a1" aria-hidden="true">Accordion section 1</label>
|
||||
<div>
|
||||
<h3>Section 1</h3>
|
||||
<p>This is the first accordion section's content.</p>
|
||||
</div>
|
||||
<input type="radio" name="accordion" id="a2"aria-hidden="true">
|
||||
<label for="a2" aria-hidden="true">Accordion section 2</label>
|
||||
<div>
|
||||
<h3>Section 2</h3>
|
||||
<p>This is the second accordion section's content.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tabs stacked">
|
||||
<input type="checkbox" id="c1" aria-hidden="true">
|
||||
<label for="c1" aria-hidden="true">Collapse section 1</label>
|
||||
<div>
|
||||
<p>This is the first collapse section's content.</p>
|
||||
</div>
|
||||
<input type="checkbox" id="c2" aria-hidden="true">
|
||||
<label for="c2" aria-hidden="true">Collapse section 2</label>
|
||||
<div>
|
||||
<p>This is the second collapse section's content.</p>
|
||||
</div>
|
||||
</div></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h3>Notes</h3>
|
||||
<ul>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li><code>.stacked</code> tabs can be used with either checkboxes or radio buttons.</li>
|
||||
<li>You can mix and match checkboxes and radio buttons, but we suggest you do not do so, unless you think it is necessary for your design.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<pre><!-- do code --></pre>
|
||||
<p class="do"><mark class="tertiary">Do:</mark> </p>
|
||||
<pre><div class="tabs stacked">
|
||||
<input type="checkbox" id="c1" aria-hidden="true">
|
||||
<label for="c1" aria-hidden="true">Single collapse</label>
|
||||
<div>
|
||||
<p>This is a singular collapse.</p>
|
||||
</div>
|
||||
</div></pre>
|
||||
<p class="do"><mark class="tertiary">Do:</mark> You can implement single collapses (otherwise known as spoilers), using a <code>.tabs</code><code>.stacked</code> container with only one checkbox-based tab.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 col-sm-last col-md-normal">
|
||||
<pre><!-- don't code --></pre>
|
||||
<p class="dont"><mark class="secondary">Don't:</mark> </p>
|
||||
<pre><div class="tabs stacked">
|
||||
<input type="radio" name="accordion" id="a1" checked aria-hidden="true">
|
||||
<label for="a1" aria-hidden="true">Single accordion section</label>
|
||||
<div>
|
||||
<p>This accordion section cannot close once opened</p>
|
||||
</div>
|
||||
</div></pre>
|
||||
<p class="dont"><mark class="secondary">Don't:</mark> Avoid having a single radio-based tab in a <code>.tabs</code><code>.stacked</code> container, as this might result in unexpected behavior.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user