UNPKG

3.54 kBHTMLView Raw
1<!doctype html>
2<html lang="en">
3 <head>
4 ${require('./_head.html')
5 title="Buttons"
6 description="The essential button in pure HTML, without .classes for the default style."
7 canonical="buttons.html"
8 }
9 </head>
10
11 <body>
12 ${require('./_nav.html')}
13
14 <main class="container" id="docs">
15 ${require('./_sidebar.html') active="buttons-link"}
16
17 <div role="document">
18 <section id="buttons">
19 <hgroup>
20 <h1>Buttons</h1>
21 <h2>The essential button in pure HTML, without <code>.classes</code> for the default style.</h2>
22 </hgroup>
23 <article aria-label="Button example">
24 <button aria-label="Button">Button</button>
25 <input type="submit">
26 <footer class="code">
27
28<pre><code>&lt;<b>button</b>&gt;Button&lt;/<b>button</b>&gt;
29&lt;<b>input</b> <i>type</i>=<u>"submit"</u>&gt;</code></pre>
30
31 </footer>
32 </article>
33 <p>Buttons are <code><i>width</i>: <u>100%</u>;</code> by default. Use <code><i>role</i>=<u>"button"</code> on an inline element if you need an inline button.</p>
34 <article aria-label="Inline buttons examples">
35 <a href="#" onclick="event.preventDefault()" role="button">Link</a>
36 <a href="#" onclick="event.preventDefault()" role="button">Link</a>
37 <footer class="code">
38
39<pre><code>&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u>&gt;Link&lt;/<b>a</b>&gt;
40&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u>&gt;Link&lt;/<b>a</b>&gt;</code></pre>
41
42 </footer>
43 </article>
44 <p>Buttons come with <code>.secondary</code> and <code>.contrast</code> styles.</p>
45 <p>ℹ️&nbsp;These classes are not available in the <a href="classless.html">class-less version</a>.</p>
46 <article aria-label="Buttons styles examples">
47 <a href="#" onclick="event.preventDefault()" role="button" class="secondary">Secondary</a>
48 <a href="#" onclick="event.preventDefault()" role="button" class="contrast">Contrast</a>
49 <footer class="code">
50
51<pre><code>&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"secondary"</u>&gt;Secondary&lt;/<b>a</b>&gt;
52&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"contrast"</u>&gt;Contrast&lt;/<b>a</b>&gt;</code></pre>
53
54 </footer>
55 </article>
56 <p>And a classic <code>.outline</code> variant.</p>
57 <article aria-label="Outline style examples">
58 <a href="#" onclick="event.preventDefault()" role="button" class="outline">Primary</a>
59 <a href="#" onclick="event.preventDefault()" role="button" class="secondary outline">Secondary</a>
60 <a href="#" onclick="event.preventDefault()" role="button" class="contrast outline">Contrast</a>
61 <footer class="code">
62
63<pre><code>&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"outline"</u>&gt;Primary&lt;/<b>a</b>&gt;
64&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"secondary outline"</u>&gt;Secondary&lt;/<b>a</b>&gt;
65&lt;<b>a</b> <i>href</i>=<u>"#"</u> <i>role</i>=<u>"button"</u> <i>class</i>=<u>"contrast outline"</u>&gt;Contrast&lt;/<b>a</b>&gt;</code></pre>
66
67 </footer>
68 </article>
69 </section>
70
71 ${require('./_footer.html')}
72
73 </div>
74 </main>
75 <script src="js/commons.min.js"></script>
76 </body>
77</html>