mirror of
https://github.com/picocss/pico.git
synced 2025-04-23 01:46:14 -04:00
Docs: Modal
This commit is contained in:
parent
0b3f1656f2
commit
31c16b00ca
4 changed files with 34 additions and 6 deletions
|
@ -138,7 +138,30 @@
|
|||
</footer>
|
||||
</article>
|
||||
|
||||
<p>As Pico focuses on CSS styles, we have not integrated any JavaScript in the library.</p>
|
||||
<p>Pico does not include JavaScript code. You will need to implement your JS to interact with modals.</p>
|
||||
|
||||
<p>As a starting point, you can look at the JavaScript used in this documentation: <a href="https://github.com/picocss/pico/blob/dev/docs/js/modal.js">js/modal.js</a>.</p>
|
||||
|
||||
<p>To make a modal appear, add the <code><i>open</i></code> attribute to the <code><<b>dialog</b></u>></code> container.</p>
|
||||
|
||||
<pre><code><em><!-- Open modal--></em>
|
||||
<<b>dialog</b> <i>open</i>>
|
||||
</<b>dialog</b>>
|
||||
|
||||
<em><!-- Modal closed --></em>
|
||||
<<b>dialog</b>>
|
||||
</<b>dialog</b>>
|
||||
</code></pre>
|
||||
|
||||
<h2>Utilities</h2>
|
||||
|
||||
<p>Modals come with 3 utility classes.</p>
|
||||
|
||||
<p><code><<b>html</b> <i>class</i>=<u>"modal-is-open"</u>></code> blurs the background and blocks any scrolling and interactions below the modal.</p>
|
||||
|
||||
<p><code><<b>html</b> <i>class</i>=<u>"modal-is-opening"</u>></code> brings an opening animation.</p>
|
||||
|
||||
<p><code><<b>html</b> <i>class</i>=<u>"modal-is-closing"</u>></code> brings a closing animation.</p>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue