Skip to content

Commit 3d1e573

Browse files
authored
feat: add dark theme support for static html files (#373)
* Add dark theme styling * Add auto detect preferred color scheme
1 parent b6133a1 commit 3d1e573

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

resources/css/style.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,29 @@
175175
right: 8px;
176176
top: 38px;
177177
}
178+
}
179+
180+
/* Dark Theme Styles */
181+
@media (prefers-color-scheme: dark) {
182+
body.dark-theme {
183+
background-color: #2a2a2a; /* Softer gray background */
184+
color: #e0e0e0;
185+
}
186+
body.dark-theme h1 {
187+
color: #e0e0e0;
188+
}
189+
body.dark-theme p {
190+
color: #b0b0b0;
191+
}
192+
body.dark-theme .btn-primary {
193+
background-color: #3a3a3a;
194+
border-color: #545454;
195+
}
196+
body.dark-theme .btn-primary:hover {
197+
background-color: #545454;
198+
}
199+
body.dark-theme .card {
200+
background-color: #3a3a3a;
201+
border-color: #545454;
202+
}
178203
}

resources/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ <h5 class="modal-title">Terms of Service</h5>
151151
if (processor === 'zebedee') {
152152
document.getElementById('powered-by-zebedee').classList.remove('d-none')
153153
}
154+
155+
// Check for system preference on load
156+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
157+
document.body.classList.add('dark-theme');
158+
}
154159
}
155160
</script>
156161
</body>

resources/invoices.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ <h2 class="text-danger">Invoice expired!</h2>
9898
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
9999
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
100100
<script>
101+
// Check for system preference on load
102+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
103+
document.body.classList.add('dark-theme');
104+
}
105+
101106
var reference = "{{reference}}"
102107
var relayUrl = "{{relay_url}}"
103108
var relayPubkey = "{{relay_pubkey}}"

resources/terms.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,11 @@ <h3>Terms of Service Agreement</h3>
6262
</div>
6363
</main>
6464
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
65+
<script>
66+
// Check for system preference on load
67+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
68+
document.body.classList.add('dark-theme');
69+
}
70+
</script>
6571
</body>
6672
</html>

0 commit comments

Comments
 (0)