mirror of
https://github.com/picocss/pico.git
synced 2025-04-23 18:06:14 -04:00
Merge branch 'dev' into ll/refactor/nav
This commit is contained in:
commit
a039b2fd4b
51 changed files with 730 additions and 82 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
43
docs/dropdown.html
Normal file
43
docs/dropdown.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -43,6 +43,7 @@
|
|||
<ul>
|
||||
<li><a href="./accordions.html" id="accordions-link" class="secondary">Accordions</a></li>
|
||||
<li><a href="./cards.html" id="cards-link" class="secondary">Cards</a></li>
|
||||
<li><a href="./dropdown.html" id="dropdown-link" class="secondary">Dropdown</a></li>
|
||||
<li><a href="./modal.html" id="modal-link" class="secondary">Modal</a></li>
|
||||
<li><a href="./navs.html" id="navs-link" class="secondary">Navs</a></li>
|
||||
<li><a href="./progress.html" id="progress-link" class="secondary">Progress</a></li>
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
</hgroup>
|
||||
<article aria-label="Accordions examples">
|
||||
<details>
|
||||
<summary>Collapsible elements 1</summary>
|
||||
<summary>Accordion 1</summary>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque urna diam, tincidunt nec porta sed, auctor id velit. Etiam venenatis nisl ut orci consequat, vitae tempus quam commodo. Nulla non mauris ipsum. Aliquam eu posuere orci. Nulla convallis lectus rutrum quam hendrerit, in facilisis elit sollicitudin. Mauris pulvinar pulvinar mi, dictum tristique elit auctor quis. Maecenas ac ipsum ultrices, porta turpis sit amet, congue turpis.</p>
|
||||
</details>
|
||||
<details open>
|
||||
<summary>Collapsible elements 2</summary>
|
||||
<summary>Accordion 2</summary>
|
||||
<ul>
|
||||
<li>Vestibulum id elit quis massa interdum sodales.</li>
|
||||
<li>Nunc quis eros vel odio pretium tincidunt nec quis neque.</li>
|
||||
|
@ -37,18 +37,54 @@
|
|||
<footer class="code">
|
||||
|
||||
<pre><code><<b>details</b>>
|
||||
<<b>summary</b>>Collapsible elements 1</<b>summary</b>>
|
||||
<<b>summary</b>>Accordion 1</<b>summary</b>>
|
||||
<<b>p</b>>…</<b>p</b>>
|
||||
</<b>details</b>>
|
||||
|
||||
<<b>details</b> <i>open</i>>
|
||||
<<b>summary</b>>Collapsible elements 2</<b>summary</b>>
|
||||
<<b>summary</b>>Accordion 2</<b>summary</b>>
|
||||
<<b>ul</b>>
|
||||
<<b>li</b>>…</<b>li</b>>
|
||||
<<b>li</b>>…</<b>li</b>>
|
||||
</<b>ul</b>>
|
||||
</<b>details</b>></code></pre>
|
||||
|
||||
</footer>
|
||||
</article>
|
||||
<p><code><i>role</i>=<u>"button"</u></code> can be used to turn <code><<b>summary</b>></code> into a button.</p>
|
||||
<article aria-label="Accordions buttons examples">
|
||||
<details>
|
||||
<summary role="button">Accordion 1</summary>
|
||||
<p>Aenean vestibulum nunc at libero congue, eu pretium nulla viverra. Fusce sed ex at est egestas vehicula. Integer sit amet lectus mi. Duis ut viverra mauris, at laoreet enim.</p>
|
||||
</details>
|
||||
<details>
|
||||
<summary role="button" class="secondary">Accordion 2</summary>
|
||||
<p>Quisque porta dictum ipsum nec vestibulum. Suspendisse non mi ac tellus scelerisque egestas. Sed vel nisi laoreet, rhoncus urna quis, luctus risus. Donec vitae molestie felis.</p>
|
||||
</details>
|
||||
<details>
|
||||
<summary role="button" class="contrast">Accordion 3</summary>
|
||||
<p>Praesent quam ipsum, condimentum non augue at, porttitor interdum tellus. Curabitur ultrices consectetur leo, a placerat mauris malesuada et. In quis varius risus.</p>
|
||||
</details>
|
||||
<footer class="code">
|
||||
|
||||
<pre><code><em><!-- Primary --></em>
|
||||
<<b>details</b>>
|
||||
<<b>summary</b> <i>role</i>=<u>"button"</u>>Accordion 1</<b>summary</b>>
|
||||
<<b>p</b>>…</<b>p</b>>
|
||||
</<b>details</b>>
|
||||
|
||||
<em><!-- Secondary --></em>
|
||||
<<b>details</b>>
|
||||
<<b>summary</b> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"secondary"</u>>Accordion 2</<b>summary</b>>
|
||||
<<b>p</b>>…</<b>p</b>>
|
||||
</<b>details</b>>
|
||||
|
||||
<em><!-- Contrast --></em>
|
||||
<<b>details</b>>
|
||||
<<b>summary</b> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"contrast"</u>>Accordion 3</<b>summary</b>>
|
||||
<<b>p</b>>…</<b>p</b>>
|
||||
</<b>details</b>>
|
||||
|
||||
</footer>
|
||||
</article>
|
||||
</section>
|
||||
|
|
128
docs/src/dropdown.html
Normal file
128
docs/src/dropdown.html
Normal file
|
@ -0,0 +1,128 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
${require('./_head.html') title="Dropdown" description="a dropdown
|
||||
component, without JavaScript." canonical="dropdown.html" }
|
||||
</head>
|
||||
|
||||
<body>
|
||||
${require('./_nav.html')}
|
||||
|
||||
<main class="container" id="docs">
|
||||
${require('./_sidebar.html') active="dropdown-link"}
|
||||
|
||||
<div role="document">
|
||||
<section id="dropdown">
|
||||
<hgroup>
|
||||
<h1>Dropdown</h1>
|
||||
<h2>single / multi select dropdown, without JavaScript.</h2>
|
||||
</hgroup>
|
||||
<article aria-label="Dropdown examples">
|
||||
<details role="list">
|
||||
<summary aria-haspopup="listbox">Single select</summary>
|
||||
<ul role="listbox">
|
||||
<li>
|
||||
<label for="01">
|
||||
<input type="radio" id="01" name="option1" />
|
||||
Option 1
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label for="02">
|
||||
<input type="radio" id="02" name="option1" />
|
||||
Option 2
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
<details role="list">
|
||||
<summary aria-haspopup="listbox">Multi-select</summary>
|
||||
<ul role="listbox">
|
||||
<li>
|
||||
<label for="11">
|
||||
<input type="checkbox" id="11" name="option2" />
|
||||
Option 1
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label for="12">
|
||||
<input type="checkbox" id="12" name="option2" />
|
||||
Option 2
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</article>
|
||||
|
||||
<label><strong>Usage notes</strong></label>
|
||||
<ul>
|
||||
<li>
|
||||
in order to use dropdown component, use
|
||||
<code>role='list'</code> on details tag.
|
||||
</li>
|
||||
<li>
|
||||
no need to use javascript to close the dropdown when clicked
|
||||
outside.
|
||||
</li>
|
||||
<li>
|
||||
for both single / multi-select case, need javascript to update
|
||||
<code>summary</code> tag text when any option selected.
|
||||
</li>
|
||||
<li>
|
||||
in case of single select, remove <code>open</code> attribute on
|
||||
<code>details</code> tag using javascript when an option is
|
||||
selected.
|
||||
</li>
|
||||
</ul>
|
||||
<footer class="code">
|
||||
<pre>
|
||||
<code>
|
||||
<em><!-- For Single-select --></em>
|
||||
<<b>details role="list"</b>>
|
||||
<<b>summary aria-haspopup="listbox"</b>>Single select<<b>/summary</b>>
|
||||
<<b>ul role="listbox"</b>>
|
||||
<<b>li</b>>
|
||||
<<b>label for="01"</b>>
|
||||
<<b>input type="radio" id="01" name="option1" /</b>>
|
||||
Option 1
|
||||
<<b>/label</b>>
|
||||
<<b>/li</b>>
|
||||
<<b>li</b>>
|
||||
<<b>label for="02"</b>>
|
||||
<<b>input type="radio" id="02" name="option1" /</b>>
|
||||
Option 2
|
||||
<<b>/label</b>>
|
||||
<<b>/li</b>>
|
||||
<<b>/ul</b>>
|
||||
<<b>/details</b>>
|
||||
|
||||
|
||||
<em><!-- For Multi-select --></em>
|
||||
<<b>details role="list"</b>>
|
||||
<<b>summary aria-haspopup="listbox"</b>>Multi select<<b>/summary</b>>
|
||||
<<b>ul role="listbox"</b>>
|
||||
<<b>li</b>>
|
||||
<<b>label for="01"</b>>
|
||||
<<b>input type="checkbox" id="01" name="option1" /</b>>
|
||||
Option 1
|
||||
<<b>/label</b>>
|
||||
<<b>/li</b>>
|
||||
<<b>li</b>>
|
||||
<<b>label for="01"</b>>
|
||||
<<b>input type="checkbox" id="02" name="option1" /</b>>
|
||||
Option 2
|
||||
<<b>/label</b>>
|
||||
<<b>/li</b>>
|
||||
<<b>/ul</b>>
|
||||
<<b>/details</b>>
|
||||
</code>
|
||||
</pre>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
${require('./_footer.html')}
|
||||
</div>
|
||||
</main>
|
||||
<script src="js/commons.min.js"></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue