Skip to content

Commit a008edc

Browse files
committed
Docs: Use switches instead of buttons to demonstrate theming
1 parent 92abca3 commit a008edc

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

examples/theming.html

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@
5555
--lmcccm-btn-secondary-hover-text: var(--lmcccm-link-hover-text);
5656
--lmcccm-btn-secondary-active-text: var(--lmcccm-link-active-text);
5757
}
58-
59-
#darkmode-icon-moon {
60-
display: none;
61-
}
62-
63-
.c_darkmode #darkmode-icon-moon {
64-
display: inline;
65-
}
66-
67-
.c_darkmode #darkmode-icon-sun {
68-
display: none;
69-
}
7058
</style>
7159
</head>
7260
<body style="padding-bottom: 380px">
@@ -138,8 +126,17 @@ <h2 class="mt-4 mt-md-5 mb-3">Without Spirit Design System</h2>
138126
Head over to <a href="https://github.com/lmc-eu/cookie-consent-manager#without-spirit-design-system">README</a>
139127
to get the full list of available CSS custom properties.
140128
</p>
129+
<div class="mb-4 p-3 border rounded d-flex">
130+
<label class="form-check-label flex-fill" for="f_custom-theme">
131+
<i class="bi bi-palette me-2"></i>
132+
Apply custom theme
133+
</label>
134+
<div class="form-check form-switch">
135+
<input class="form-check-input" type="checkbox" id="f_custom-theme" onchange="document.documentElement.classList.toggle('custom-theme')" autocomplete="off">
136+
</div>
137+
</div>
141138
<details class="mb-4">
142-
<summary class="link-primary">Example theme:</summary>
139+
<summary class="link-primary">Show source</summary>
143140
<pre class="mt-4"><code class="language-css">:root {
144141
--lmcccm-font-family: 'Noto Sans', 'Roboto', 'Open Sans', system-ui, sans-serif;
145142
--lmcccm-base-font-size: 14px;
@@ -160,28 +157,24 @@ <h2 class="mt-4 mt-md-5 mb-3">Without Spirit Design System</h2>
160157
--lmcccm-btn-secondary-active-text: var(--lmcccm-link-active-text);
161158
}</code></pre>
162159
</details>
163-
<p>
164-
<button type="button" class="btn btn-outline-primary" onclick="document.documentElement.classList.toggle('custom-theme')">
165-
<i class="bi bi-palette"></i>
166-
Toggle custom theme
167-
</button>
168-
</p>
169160

170161
<h2 class="mt-4 mt-md-5 mb-3">Dark Mode</h2>
171162
<p class="mb-4">
172-
Default dark mode of Cookie Consent Manager is rather a dark version than a real dark mode
163+
The default dark mode of Cookie Consent Manager is rather a dark version than a real dark mode,
173164
which is not yet supported by Spirit (if it was, it would apply less contrasting colors).
174165
But it's available for you to have more design choices to choose from. You can
175166
<a href="https://github.com/lmc-eu/cookie-consent-manager#dark-mode">customize</a>
176167
dark mode colors the same way as the default light color scheme.
177168
</p>
178-
<p>
179-
<button type="button" class="btn btn-outline-dark" onclick="document.body.classList.toggle('c_darkmode')">
180-
<i id="darkmode-icon-moon" class="bi bi-moon"></i>
181-
<i id="darkmode-icon-sun" class="bi bi-sun"></i>
182-
Toggle dark mode
183-
</button>
184-
</p>
169+
<div class="p-3 border rounded d-flex">
170+
<label class="form-check-label flex-fill" for="f_dark-mode">
171+
<i class="bi bi-moon me-2"></i>
172+
Turn on dark mode
173+
</label>
174+
<div class="form-check form-switch">
175+
<input class="form-check-input" type="checkbox" id="f_dark-mode" onchange="document.body.classList.toggle('c_darkmode');" autocomplete="off">
176+
</div>
177+
</div>
185178

186179
</div>
187180
</div>

0 commit comments

Comments
 (0)