fix: align new-session styling and improve dark theme startup

This commit is contained in:
Shantur Rathore
2025-10-29 00:44:51 +00:00
parent 317d076117
commit 30992fbf48
6 changed files with 205 additions and 48 deletions

View File

@@ -4,6 +4,37 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OpenCode Client</title>
<style>
:root {
color-scheme: light dark;
}
html,
body {
background-color: #ffffff;
color: #1a1a1a;
}
@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')
}
} catch (error) {
console.warn('Failed to apply initial theme', error)
}
})()
</script>
</head>
<body>
<div id="root"></div>