Force dark theme defaults across shells

This commit is contained in:
Shantur Rathore
2025-11-23 10:00:16 +00:00
parent 4062b43380
commit 073604c9f5
4 changed files with 17 additions and 38 deletions

View File

@@ -6,30 +6,18 @@
<title>CodeNomad</title>
<style>
:root {
color-scheme: light dark;
color-scheme: dark;
}
/* html,
html,
body {
background-color: #ffffff;
color: #1a1a1a;
background-color: #1a1a1a;
color: #e0e0e0;
}
@media (prefers-color-scheme: dark) { */
html,
body {
background-color: #1a1a1a;
color: #e0e0e0;
}
/* } */
</style>
<script>
;(function () {
try {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
// if (prefersDark) {
document.documentElement.setAttribute('data-theme', 'dark')
// } else {
// document.documentElement.removeAttribute('data-theme')
// }
document.documentElement.setAttribute('data-theme', 'dark')
} catch (error) {
console.warn('Failed to apply initial theme', error)
}

View File

@@ -7,12 +7,7 @@
<script>
;(function () {
try {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
if (prefersDark) {
document.documentElement.setAttribute('data-theme', 'dark')
} else {
document.documentElement.setAttribute('data-theme', 'light')
}
document.documentElement.setAttribute('data-theme', 'dark')
} catch (error) {
console.warn('Failed to apply initial theme', error)
}