UNPKG

2.83 kBHTMLView Raw
1<!doctype html>
2<html lang="en">
3 <head>
4 ${require('./_head.html')
5 title="Themes"
6 description="Pico is shipped with 2 consistent themes: Light & Dark. The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled ('prefers-color-scheme: dark')."
7 canonical="themes.html"
8 }
9 </head>
10
11 <body>
12 ${require('./_nav.html')}
13
14 <main class="container" id="docs">
15 ${require('./_sidebar.html') active="themes-link"}
16
17 <div role="document">
18 <section id="themes">
19 <hgroup>
20 <h1>Themes</h1>
21 <h2>Pico is shipped with 2 consistent themes: Light & Dark.</h2>
22 </hgroup>
23 <p>The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled <code><i>prefers-color-scheme</i>: <u>dark</u></code></p>
24 <article aria-label="Theme switcher">
25 <button class="contrast theme-switcher"></button>
26 </article>
27 <p>Themes can be forced on document level <code>&lt;<b>html</b> <i>data-theme</i>=<u>"light"</u>&gt;</code> or on any HTML element <code>&lt;<b>article</b> <i>data-theme</i>=<u>"dark"</u>&gt;</code></p>
28 <article data-theme="light" aria-label="Forced light theme example">
29 <h3>Light theme</h3>
30 <form class="grid">
31 <input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="nickname" required>
32 <input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required>
33 <button type="submit" aria-label="Example button" onclick="event.preventDefault()">Login</button>
34 </form>
35 <footer class="code">
36
37<pre><code>&lt;<b>article</b> <i>data-theme</i>=<u>"light"</u>&gt;
38
39&lt;/<b>article</b>&gt;</code></pre>
40
41 </footer>
42 </article>
43 <article data-theme="dark" aria-label="Forced dark theme example">
44 <h3>Dark theme</h3>
45 <form class="grid">
46 <input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="nickname" required>
47 <input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required>
48 <button type="submit" aria-label="Example button" onclick="event.preventDefault()">Login</button>
49 </form>
50 <footer class="code">
51
52<pre><code>&lt;<b>article</b> <i>data-theme</i>=<u>"dark"</u>&gt;
53
54&lt;/<b>article</b>&gt;</code></pre>
55
56 </footer>
57 </article>
58 </section>
59
60 ${require('./_footer.html')}
61
62 </div>
63 </main>
64 <script src="js/commons.min.js"></script>
65 </body>
66</html>